@@ -1962,38 +1962,36 @@ def foo():
19621962
19631963 self .assertNotIn ("something" , err .getvalue ())
19641964
1965- # TODO: RUSTPYTHON
1966- # def test_issue45826(self):
1967- # # regression test for bpo-45826
1968- # def f():
1969- # with self.assertRaisesRegex(NameError, 'aaa'):
1970- # aab
1965+ def test_issue45826 (self ):
1966+ # regression test for bpo-45826
1967+ def f ():
1968+ with self .assertRaisesRegex (NameError , 'aaa' ):
1969+ aab
19711970
1972- # try:
1973- # f()
1974- # except self.failureException:
1975- # with support.captured_stderr() as err:
1976- # sys.__excepthook__(*sys.exc_info())
1971+ try :
1972+ f ()
1973+ except self .failureException :
1974+ with support .captured_stderr () as err :
1975+ sys .__excepthook__ (* sys .exc_info ())
19771976
1978- # self.assertIn("aab", err.getvalue())
1977+ self .assertIn ("aab" , err .getvalue ())
19791978
1980- # TODO: RUSTPYTHON
1981- # def test_issue45826_focused(self):
1982- # def f():
1983- # try:
1984- # nonsense
1985- # except BaseException as E:
1986- # E.with_traceback(None)
1987- # raise ZeroDivisionError()
1979+ def test_issue45826_focused (self ):
1980+ def f ():
1981+ try :
1982+ nonsense
1983+ except BaseException as E :
1984+ E .with_traceback (None )
1985+ raise ZeroDivisionError ()
19881986
1989- # try:
1990- # f()
1991- # except ZeroDivisionError:
1992- # with support.captured_stderr() as err:
1993- # sys.__excepthook__(*sys.exc_info())
1987+ try :
1988+ f ()
1989+ except ZeroDivisionError :
1990+ with support .captured_stderr () as err :
1991+ sys .__excepthook__ (* sys .exc_info ())
19941992
1995- # self.assertIn("nonsense", err.getvalue())
1996- # self.assertIn("ZeroDivisionError", err.getvalue())
1993+ self .assertIn ("nonsense" , err .getvalue ())
1994+ self .assertIn ("ZeroDivisionError" , err .getvalue ())
19971995
19981996
19991997class AttributeErrorTests (unittest .TestCase ):
0 commit comments