Skip to content

Commit b633af8

Browse files
committed
Simplify TestMonitor.
The executor is now registered immediately, don't need to wait.
1 parent 9d9b65e commit b633af8

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

test/test_monitor.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
from test.utils import single_client, one, connected, wait_until
2626

2727

28-
def registered(executor):
29-
for ref in _EXECUTORS.copy():
30-
if ref() is executor:
31-
return ref
32-
33-
return None
34-
35-
3628
def unregistered(ref):
3729
gc.collect()
3830
return ref not in _EXECUTORS
@@ -45,7 +37,7 @@ def test_atexit_hook(self):
4537
connected(client)
4638

4739
# The executor stores a weakref to itself in _EXECUTORS.
48-
ref = wait_until(partial(registered, executor), 'register executor')
40+
ref = one(r for r in _EXECUTORS.copy() if r() is executor)
4941

5042
del executor
5143
del client

0 commit comments

Comments
 (0)