@@ -372,7 +372,7 @@ def g2():
372372 return [42 ]
373373 self .assertEqual (list (g1 ()), ["g2" ])
374374
375-
375+ @ unittest . skipIf ( sys . version_info . minor < 7 , "Requires Python 3.7+" )
376376 def test_generator_return_value (self ):
377377 """
378378 Test generator return value
@@ -419,7 +419,7 @@ def g2(v = None):
419419 "Yielded g2 spam" ,
420420 "Yielded g2 more spam" ,
421421 "Finishing g2" ,
422- "g2 returned StopIteration(3, )" ,
422+ "g2 returned StopIteration(3)" ,
423423 "Yielded g1 eggs" ,
424424 "Finishing g1" ,
425425 ])
@@ -666,6 +666,7 @@ class LunchError(Exception):
666666 "Finishing g1" ,
667667 ])
668668
669+ @unittest .skipIf (sys .version_info .minor < 7 , "Requires Python 3.7+" )
669670 def test_next_and_return_with_value (self ):
670671 """
671672 Test next and return with value
@@ -697,17 +698,18 @@ def g(r):
697698 "g starting" ,
698699 "f resuming g" ,
699700 "g returning 1" ,
700- "f caught StopIteration(1, )" ,
701+ "f caught StopIteration(1)" ,
701702 "g starting" ,
702703 "f resuming g" ,
703704 "g returning (2,)" ,
704- "f caught StopIteration((2,), )" ,
705+ "f caught StopIteration((2,))" ,
705706 "g starting" ,
706707 "f resuming g" ,
707- "g returning StopIteration(3, )" ,
708- "f caught StopIteration(StopIteration(3,), )" ,
708+ "g returning StopIteration(3)" ,
709+ "f caught StopIteration(StopIteration(3) )" ,
709710 ])
710711
712+ @unittest .skipIf (sys .version_info .minor < 7 , "Requires Python 3.7+" )
711713 def test_send_and_return_with_value (self ):
712714 """
713715 Test send and return with value
@@ -742,17 +744,17 @@ def g(r):
742744 "f sending spam to g" ,
743745 "g received 'spam'" ,
744746 "g returning 1" ,
745- 'f caught StopIteration(1, )' ,
747+ 'f caught StopIteration(1)' ,
746748 'g starting' ,
747749 'f sending spam to g' ,
748750 "g received 'spam'" ,
749751 'g returning (2,)' ,
750- 'f caught StopIteration((2,), )' ,
752+ 'f caught StopIteration((2,))' ,
751753 'g starting' ,
752754 'f sending spam to g' ,
753755 "g received 'spam'" ,
754- 'g returning StopIteration(3, )' ,
755- 'f caught StopIteration(StopIteration(3,), )'
756+ 'g returning StopIteration(3)' ,
757+ 'f caught StopIteration(StopIteration(3) )'
756758 ])
757759
758760 # def test_catching_exception_from_subgen_and_returning(self):
0 commit comments