File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Lib/test/test_unittest/testmock Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -204,16 +204,14 @@ class TestThreadingMockRaceCondition(unittest.TestCase):
204204
205205 def setUp (self ):
206206 self ._executor = concurrent .futures .ThreadPoolExecutor (max_workers = 5 )
207+ self .addCleanup (self ._executor .shutdown )
207208
208209 # Store and restore original switch interval using addCleanup
209210 self .addCleanup (sys .setswitchinterval , sys .getswitchinterval ())
210211
211212 # Set switch interval to minimum to force frequent context switches
212213 sys .setswitchinterval (sys .float_info .min )
213214
214- def tearDown (self ):
215- self ._executor .shutdown ()
216-
217215 def test_call_count_race_condition_with_fast_switching (self ):
218216 """Force race condition by maximizing thread context switches.
219217
You can’t perform that action at this time.
0 commit comments