@@ -803,7 +803,7 @@ def test_without_pickling(self):
803
803
c = ag .__anext__ ()
804
804
self .assertRaises (StopAsyncIteration , c .send , None )
805
805
self .assertIsNone (ag .ag_frame )
806
- self .assertRaises ( StopIteration , c .send , None )
806
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
807
807
c = ag .__anext__ ()
808
808
self .assertRaises (StopAsyncIteration , c .send , None )
809
809
@@ -822,7 +822,7 @@ def test_pickling1(self):
822
822
c = ag .__anext__ ()
823
823
self .assertRaises (StopAsyncIteration , c .send , None )
824
824
self .assertIsNone (ag .ag_frame )
825
- self .assertRaises ( StopIteration , c .send , None )
825
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
826
826
c = ag .__anext__ ()
827
827
self .assertRaises (StopAsyncIteration , c .send , None )
828
828
@@ -844,7 +844,7 @@ def test_pickling2(self):
844
844
c = ag .__anext__ ()
845
845
self .assertRaises (StopAsyncIteration , c .send , None )
846
846
self .assertIsNone (ag .ag_frame )
847
- self .assertRaises ( StopIteration , c .send , None )
847
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
848
848
c = ag .__anext__ ()
849
849
self .assertRaises (StopAsyncIteration , c .send , None )
850
850
ag = self .loads (p )
@@ -869,7 +869,7 @@ def test_pickling3(self):
869
869
p = self .dumps (ag )
870
870
ag = self .loads (p )
871
871
self .assertIsNone (ag .ag_frame )
872
- self .assertRaises ( StopIteration , c .send , None )
872
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
873
873
c = ag .__anext__ ()
874
874
self .assertRaises (StopAsyncIteration , c .send , None )
875
875
0 commit comments