From 3d72cf82e3141da781600984d7f1cc6ac2263af9 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 17 Aug 2019 14:35:31 +0100 Subject: [PATCH] tests: use defer_sync() Rather than defer() + ancient sync_with_broker() --- tests/router_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/router_test.py b/tests/router_test.py index ef3fc4d5..fb4da501 100644 --- a/tests/router_test.py +++ b/tests/router_test.py @@ -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())