Skip to content

Commit

Permalink
test: don't reuse IOLoop.instance after it's closed
Browse files Browse the repository at this point in the history
fixes tests for tornado 4.5
  • Loading branch information
minrk committed Aug 20, 2018
1 parent 5b4cf79 commit 935d7b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zmq/tests/test_zmqstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def setUp(self):
if asyncio:
asyncio.set_event_loop(asyncio.new_event_loop())
self.context = zmq.Context()
self.loop = ioloop.IOLoop.instance()
self.loop = ioloop.IOLoop()
self.loop.make_current()
self.push = zmqstream.ZMQStream(self.context.socket(zmq.PUSH))
self.pull = zmqstream.ZMQStream(self.context.socket(zmq.PULL))
port = self.push.bind_to_random_port('tcp://127.0.0.1')
Expand All @@ -37,7 +38,7 @@ def setUp(self):
def tearDown(self):
self.loop.close(all_fds=True)
self.context.term()
ioloop.IOLoop.clear_instance()
ioloop.IOLoop.clear_current()

def run_until_timeout(self, timeout=10):
timed_out = []
Expand Down

0 comments on commit 935d7b1

Please sign in to comment.