File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,8 +26,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
2626
2727### Fixed
2828
29- * The flag ` foo ` no longer retains the value ` bar ` after ` FLAGS.foo = bar `
30- fails due to a validation error.
29+ * (flags) The flag ` foo ` no longer retains the value ` bar ` after
30+ ` FLAGS.foo = bar ` fails due to a validation error.
31+ * (testing) Fixed an issue caused by
32+ [ this Python 3.12.1 change] ( https://github.com/python/cpython/pull/109725 )
33+ where the test reporter crashes when all tests are skipped.
3134
3235## 2.0.0 (2023-09-19)
3336
Original file line number Diff line number Diff line change @@ -361,6 +361,9 @@ def stopTest(self, test):
361361 test_name = test .id () or str (test )
362362 sys .stderr .write ('No pending test case: %s\n ' % test_name )
363363 return
364+ if getattr (self , 'start_time' , None ) is None :
365+ # startTest may not be called for skipped tests since Python 3.12.1.
366+ self .start_time = self .time_getter ()
364367 test_id = id (test )
365368 run_time = self .time_getter () - self .start_time
366369 result .set_run_time (run_time )
@@ -386,7 +389,7 @@ def stopTestRun(self):
386389 # reporting here.
387390 for test_id in self .pending_test_case_results :
388391 result = self .pending_test_case_results [test_id ]
389- if hasattr (self , 'start_time' ) :
392+ if getattr (self , 'start_time' , None ) is not None :
390393 run_time = self .suite .overall_end_time - self .start_time
391394 result .set_run_time (run_time )
392395 result .set_start_time (self .start_time )
You can’t perform that action at this time.
0 commit comments