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

Commit c3f61b0

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.
1 parent 105adf0 commit c3f61b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Stackless/unittests/test_pickle.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ def test_without_pickling(self):
774774
c = ag.__anext__()
775775
self.assertRaises(StopAsyncIteration, c.send, None)
776776
self.assertIsNone(ag.ag_frame)
777-
self.assertRaises(StopIteration, c.send, None)
777+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
778778
c = ag.__anext__()
779779
self.assertRaises(StopAsyncIteration, c.send, None)
780780

@@ -793,7 +793,7 @@ def test_pickling1(self):
793793
c = ag.__anext__()
794794
self.assertRaises(StopAsyncIteration, c.send, None)
795795
self.assertIsNone(ag.ag_frame)
796-
self.assertRaises(StopIteration, c.send, None)
796+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
797797
c = ag.__anext__()
798798
self.assertRaises(StopAsyncIteration, c.send, None)
799799

@@ -815,7 +815,7 @@ def test_pickling2(self):
815815
c = ag.__anext__()
816816
self.assertRaises(StopAsyncIteration, c.send, None)
817817
self.assertIsNone(ag.ag_frame)
818-
self.assertRaises(StopIteration, c.send, None)
818+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
819819
c = ag.__anext__()
820820
self.assertRaises(StopAsyncIteration, c.send, None)
821821
ag = self.loads(p)
@@ -840,7 +840,7 @@ def test_pickling3(self):
840840
p = self.dumps(ag)
841841
ag = self.loads(p)
842842
self.assertIsNone(ag.ag_frame)
843-
self.assertRaises(StopIteration, c.send, None)
843+
self.assertRaisesRegex(RuntimeError, "cannot reuse already awaited", c.send, None)
844844
c = ag.__anext__()
845845
self.assertRaises(StopAsyncIteration, c.send, None)
846846

0 commit comments

Comments
 (0)