Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added a count of how many, if any, tests were skipped.
This count is then displayed at the end of the test run as
skipped tests may not otherwise be noticed!
Loading branch information
Showing
1 changed file
with
13 additions
and
2 deletions .
+13
−2
run_tests.py
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -284,6 +284,9 @@ def _clean_orphaned_pyc():
# override flag to indicate at the end that testing failed somewhere
testing_failed = False
# count how many tests have been skipped.
skipped_test_count = 0
# loads and validates our various configurations
test_config = stem .util .conf .get_config ("test" )
@@ -333,7 +336,9 @@ def _clean_orphaned_pyc():
test .output .print_divider (test_class .__module__ )
suite = unittest .TestLoader ().loadTestsFromTestCase (test_class )
test_results = StringIO .StringIO ()
unittest .TextTestRunner (test_results , verbosity = 2 ).run (suite )
run_result = unittest .TextTestRunner (test_results , verbosity = 2 ).run (suite )
if stem .prereq .is_python_27 ():
skipped_test_count += len (run_result .skipped )
sys .stdout .write (test .output .apply_filters (test_results .getvalue (), * output_filters ))
print
@@ -409,7 +414,9 @@ def _clean_orphaned_pyc():
test .output .print_divider (test_class .__module__ )
suite = unittest .TestLoader ().loadTestsFromTestCase (test_class )
test_results = StringIO .StringIO ()
unittest .TextTestRunner (test_results , verbosity = 2 ).run (suite )
run_result = unittest .TextTestRunner (test_results , verbosity = 2 ).run (suite )
if stem .prereq .is_python_27 ():
skipped_test_count += len (run_result .skipped )
sys .stdout .write (test .output .apply_filters (test_results .getvalue (), * output_filters ))
print
@@ -473,6 +480,10 @@ def _clean_orphaned_pyc():
for line in error_tracker :
test .output .print_line (" %s" % line , * ERROR_ATTR )
elif skipped_test_count > 0 :
test .output .print_line ("%i TESTS WERE SKIPPED" % skipped_test_count , term .Color .BLUE , term .Attr .BOLD )
test .output .print_line ("ALL OTHER TESTS PASSED %s" % runtime_label , term .Color .GREEN , term .Attr .BOLD )
print
else :
test .output .print_line ("TESTING PASSED %s" % runtime_label , term .Color .GREEN , term .Attr .BOLD )
print
Toggle all file notes
Toggle all file annotations