@@ -3784,7 +3784,7 @@ def test_dont_swallow_cause_or_context_of_falsey_exception(self):
37843784
37853785 for exc in (FalseyBoolException , FalseyLenException ):
37863786 try :
3787- raise exc ( 0 ) from KeyError
3787+ raise exc from KeyError
37883788 except exc as e :
37893789 self .assertIn (cause_message , traceback .format_exception (e ))
37903790
@@ -3793,7 +3793,7 @@ def test_dont_swallow_cause_or_context_of_falsey_exception(self):
37933793 try :
37943794 1 / 0
37953795 except :
3796- raise exc ( 1 )
3796+ raise exc
37973797 except exc as e :
37983798 self .assertIn (context_message , traceback .format_exception (e ))
37993799
@@ -4004,7 +4004,7 @@ def test_dont_swallow_subexceptions_of_falsey_exceptiongroup(self):
40044004 # Recall: `x` is falsey if `len(x)` returns 0 or `bool(x)` returns False.
40054005
40064006 try :
4007- raise FalseyExceptionGroup ("Gih" , (KeyError (2 ), NameError ('Guh' )))
4007+ raise FalseyExceptionGroup ("Gih" , (KeyError (), NameError ()))
40084008 except Exception as ee :
40094009 str_exc = '' .join (traceback .format_exception (ee ))
40104010 self .assertIn ('+---------------- 1 ----------------' , str_exc )
@@ -4013,11 +4013,12 @@ def test_dont_swallow_subexceptions_of_falsey_exceptiongroup(self):
40134013 # Test with a falsey exception, in last position, as sub-exceptions.
40144014 msg = 'bool'
40154015 try :
4016- raise FalseyExceptionGroup ("Gih " , (KeyError (2 ), FalseyBoolException (msg )))
4016+ raise FalseyExceptionGroup ("Gah " , (KeyError (), FalseyBoolException (msg )))
40174017 except Exception as ee :
40184018 str_exc = traceback .format_exception (ee )
40194019 self .assertIn (f'{ FalseyBoolException .__name__ } : { msg } ' , str_exc [- 2 ])
40204020
4021+
40214022global_for_suggestions = None
40224023
40234024
0 commit comments