@@ -774,7 +774,7 @@ def test_without_pickling(self):
774
774
c = ag .__anext__ ()
775
775
self .assertRaises (StopAsyncIteration , c .send , None )
776
776
self .assertIsNone (ag .ag_frame )
777
- self .assertRaises ( StopIteration , c .send , None )
777
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
778
778
c = ag .__anext__ ()
779
779
self .assertRaises (StopAsyncIteration , c .send , None )
780
780
@@ -793,7 +793,7 @@ def test_pickling1(self):
793
793
c = ag .__anext__ ()
794
794
self .assertRaises (StopAsyncIteration , c .send , None )
795
795
self .assertIsNone (ag .ag_frame )
796
- self .assertRaises ( StopIteration , c .send , None )
796
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
797
797
c = ag .__anext__ ()
798
798
self .assertRaises (StopAsyncIteration , c .send , None )
799
799
@@ -815,7 +815,7 @@ def test_pickling2(self):
815
815
c = ag .__anext__ ()
816
816
self .assertRaises (StopAsyncIteration , c .send , None )
817
817
self .assertIsNone (ag .ag_frame )
818
- self .assertRaises ( StopIteration , c .send , None )
818
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
819
819
c = ag .__anext__ ()
820
820
self .assertRaises (StopAsyncIteration , c .send , None )
821
821
ag = self .loads (p )
@@ -840,7 +840,7 @@ def test_pickling3(self):
840
840
p = self .dumps (ag )
841
841
ag = self .loads (p )
842
842
self .assertIsNone (ag .ag_frame )
843
- self .assertRaises ( StopIteration , c .send , None )
843
+ self .assertRaisesRegex ( RuntimeError , "cannot reuse already awaited" , c .send , None )
844
844
c = ag .__anext__ ()
845
845
self .assertRaises (StopAsyncIteration , c .send , None )
846
846
0 commit comments