tests: use defer_sync() Rather than defer() + ancient sync_with_broker()

This commit is contained in:
David Wilson 2019-08-17 14:35:31 +01:00
parent 11923431a6
commit 3d72cf82e3
1 changed files with 6 additions and 6 deletions

View File

@ -62,12 +62,12 @@ class SourceVerifyTest(testlib.RouterMixin, testlib.TestCase):
recv = mitogen.core.Receiver(self.router)
self.child2_msg.handle = recv.handle
self.broker.defer(self.router._async_route,
self.child2_msg,
in_stream=self.child1_stream)
# Wait for IO loop to finish everything above.
self.sync_with_broker()
self.broker.defer_sync(
lambda: self.router._async_route(
self.child2_msg,
in_stream=self.child1_stream
)
)
# Ensure message wasn't forwarded.
self.assertTrue(recv.empty())