Simplify TestMonitor.

The executor is now registered immediately, don't need to wait.
This commit is contained in:
A. Jesse Jiryu Davis 2015-01-12 15:26:33 -05:00
parent 9d9b65e2c2
commit b633af82a9

View File

@ -25,14 +25,6 @@ from test import unittest, port, host, IntegrationTest
from test.utils import single_client, one, connected, wait_until
def registered(executor):
for ref in _EXECUTORS.copy():
if ref() is executor:
return ref
return None
def unregistered(ref):
gc.collect()
return ref not in _EXECUTORS
@ -45,7 +37,7 @@ class TestMonitor(IntegrationTest):
connected(client)
# The executor stores a weakref to itself in _EXECUTORS.
ref = wait_until(partial(registered, executor), 'register executor')
ref = one(r for r in _EXECUTORS.copy() if r() is executor)
del executor
del client