Author: bugman
Date: Tue Oct 7 16:21:30 2014
New Revision: 26191
URL: http://svn.gna.org/viewcvs/relax?rev=26191&view=rev
Log:
Modified the printouts for the unit tests when running with the --time command
line option.
The test name is now being processed. The leading 'test_suite.unit_tests.'
text is now stripped
out. And the remaining text is split into the module name and the test name.
This is to allow the
unit test module name to be more easily identifiable, so it can then be used as
a command line
option to allow only a subset of tests to be performed.
Modified:
trunk/test_suite/relax_test_runner.py
Modified: trunk/test_suite/relax_test_runner.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/relax_test_runner.py?rev=26191&r1=26190&r2=26191&view=diff
==============================================================================
--- trunk/test_suite/relax_test_runner.py (original)
+++ trunk/test_suite/relax_test_runner.py Tue Oct 7 16:21:30 2014
@@ -21,6 +21,7 @@
# Python module imports.
import dep_check
+from re import split
import sys
from time import time
from unittest import TextTestRunner
@@ -166,10 +167,21 @@
# Subtract the end time from the start time.
self.time -= time()
- # Change the test name.
+ # Change the test name for all but unit tests.
if self.category != 'unit':
test_name = test_name.split('.')
test_name = "%s.%s" % (test_name[-2], test_name[-1])
+
+ # Modify the unit test name printout.
+ else:
+ # Strip out the leading 'test_suite.unit_tests.' text.
+ test_name = test_name.replace('test_suite.unit_tests.', '')
+
+ # Split out the module name from the test name.
+ module_name, test_name = split('.Test_', test_name)
+
+ # Rebuild the test name.
+ test_name = "module %s, test Test_%s" % (module_name, test_name)
# The printout.
self.stream.write(' %7.2f s for %s\n' % (-self.time, test_name))
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits