Skip to content

Commit a212f90

Browse files
committed
avoid testing underlying pyzmq machinery in test_tracking
the test as-written is sensitive to garbage collection, which is different on pypy instead, test only that we create a valid tracker
1 parent 399313f commit a212f90

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

jupyter_client/tests/test_session.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,13 @@ def test_tracking(self):
171171
s.copy_threshold = 1
172172
ZMQStream(a)
173173
msg = s.send(a, "hello", track=False)
174-
self.assertTrue(msg["tracker"] is ss.DONE)
174+
assert msg["tracker"] is ss.DONE
175175
msg = s.send(a, "hello", track=True)
176-
self.assertTrue(isinstance(msg["tracker"], zmq.MessageTracker))
176+
assert isinstance(msg["tracker"], zmq.MessageTracker)
177177
M = zmq.Message(b"hi there", track=True)
178178
msg = s.send(a, "hello", buffers=[M], track=True)
179179
t = msg["tracker"]
180-
self.assertTrue(isinstance(t, zmq.MessageTracker))
181-
self.assertRaises(zmq.NotDone, t.wait, 0.1)
182-
del M
183-
t.wait(1) # this will raise
180+
assert t is not ss.DONE
184181

185182
def test_unique_msg_ids(self):
186183
"""test that messages receive unique ids"""

0 commit comments

Comments
 (0)