unittest.py

changeset 123
0557709c25ec
parent 122
116a81996832
child 126
16dae12ac0f0
--- a/unittest.py	Fri Sep 18 20:32:42 2020 +0300
+++ b/unittest.py	Fri Sep 18 20:36:06 2020 +0300
@@ -91,6 +91,7 @@
         'passed': problems == expected_problems,
         'unexpected': set.difference(problems, expected_problems),
         'missing': set.difference(expected_problems, problems),
+        'problem_types': problem_types,
     }
 
 def format_problem_tuple(problem_tuple):
@@ -101,6 +102,8 @@
     test_suite = load_tests()
     num_tested = 0
     num_passed = 0
+    all_problem_types = all_problem_type_names(test_suite)
+    problem_types_tested = set()
     print('Running unit test suite.')
     for unit_test_path in unit_test_discovery():
         try:
@@ -123,6 +126,7 @@
             ))
             num_tested += 1
             num_passed += int(unit_test_report['passed'])
+            set.update(problem_types_tested, unit_test_report['problem_types'])
             if not unit_test_report['passed']:
                 def format_problem_list(key):
                     return str.join(
@@ -136,5 +140,10 @@
         num_tested = num_tested,
         num_passed = num_passed,
     ))
+    untested_problem_types = set.difference(all_problem_types, problem_types_tested)
+    if untested_problem_types:
+        print('The following problem types were not tested:')
+        for problem_type in sorted(untested_problem_types):
+            print('\t' + problem_type)
 if __name__ == '__main__':
     run_unit_test_suite()

mercurial