File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,12 +146,11 @@ async def test_wake_causes_early_run(self):
146146 woken = asyncio .Event ()
147147
148148 async def target ():
149- call_count [0 ] += 1
150- if call_count [0 ] == 1 :
149+ nonlocal call_count
150+ call_count += 1
151+ if call_count == 1 :
151152 woken .set ()
152- if call_count [0 ] >= 2 :
153- return False
154- return True
153+ return call_count < 2
155154
156155 self .executor = _make_executor (interval = 30.0 , min_interval = 0.01 , target = target )
157156 self .executor .open ()
@@ -161,7 +160,7 @@ async def target():
161160 await asyncio .wait_for (woken .wait (), timeout = 2 )
162161 self .executor .wake ()
163162 await self .executor .join (timeout = 3 )
164- self .assertGreaterEqual (call_count [ 0 ] , 2 )
163+ self .assertGreaterEqual (call_count , 2 )
165164
166165 async def test_open_after_target_returns_false (self ):
167166 called = [0 ]
You can’t perform that action at this time.
0 commit comments