Skip to content
Permalink
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
eoinof committed Oct 28, 2012
1 parent f9f0907 commit 249d9bd3809f27bc9dd99135e767cd292644ec00
Showing with 13 additions and 2 deletions.
  1. +13 −2 run_tests.py
@@ -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

0 comments on commit 249d9bd

Please sign in to comment.