Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 176c639

Browse files
author
Anselm Kruis
committed
Stackless issue #251: Fix test case broken by upstream
Upstream fix for bpo-39386 broke Stackless test case test_pickle.TestAsyncGenPickling. (cherry picked from commit c3f61b0)
1 parent c63b947 commit 176c639

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Stackless/unittests/test_pickle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def test_without_pickling(self):
803803
c = ag.__anext__()
804804
self.assertRaises(StopAsyncIteration, c.send, None)
805805
self.assertIsNone(ag.ag_frame)
806-
self.assertRaises(StopIteration, c.send, None)
806+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
807807
c = ag.__anext__()
808808
self.assertRaises(StopAsyncIteration, c.send, None)
809809

@@ -822,7 +822,7 @@ def test_pickling1(self):
822822
c = ag.__anext__()
823823
self.assertRaises(StopAsyncIteration, c.send, None)
824824
self.assertIsNone(ag.ag_frame)
825-
self.assertRaises(StopIteration, c.send, None)
825+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
826826
c = ag.__anext__()
827827
self.assertRaises(StopAsyncIteration, c.send, None)
828828

@@ -844,7 +844,7 @@ def test_pickling2(self):
844844
c = ag.__anext__()
845845
self.assertRaises(StopAsyncIteration, c.send, None)
846846
self.assertIsNone(ag.ag_frame)
847-
self.assertRaises(StopIteration, c.send, None)
847+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
848848
c = ag.__anext__()
849849
self.assertRaises(StopAsyncIteration, c.send, None)
850850
ag = self.loads(p)
@@ -869,7 +869,7 @@ def test_pickling3(self):
869869
p = self.dumps(ag)
870870
ag = self.loads(p)
871871
self.assertIsNone(ag.ag_frame)
872-
self.assertRaises(StopIteration, c.send, None)
872+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
873873
c = ag.__anext__()
874874
self.assertRaises(StopAsyncIteration, c.send, None)
875875

0 commit comments

Comments
 (0)