File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1515import types
1616import decimal
1717import unittest
18+ import warnings
1819from test import support
1920from test .support .os_helper import temp_cwd
2021from test .support .script_helper import assert_python_failure , assert_python_ok
@@ -1650,8 +1651,9 @@ def __repr__(self):
16501651 #self.assertEqual(f'X{x = }Y', 'Xx\t=\t'+repr(x)+'Y')
16511652
16521653 def test_debug_expressions_are_raw_strings (self ):
1653-
1654- self .assertEqual (f'{ b"\N{OX}" = } ' , 'b"\\ N{OX}"=b\' \\ \\ N{OX}\' ' )
1654+ with warnings .catch_warnings ():
1655+ warnings .simplefilter ('ignore' , SyntaxWarning )
1656+ self .assertEqual (eval ("""f'{b"\\ N{OX}"=}'""" ), 'b"\\ N{OX}"=b\' \\ \\ N{OX}\' ' )
16551657 self .assertEqual (f'{ r"\xff" = } ' , 'r"\\ xff"=\' \\ \\ xff\' ' )
16561658 self .assertEqual (f'{ r"\n" = } ' , 'r"\\ n"=\' \\ \\ n\' ' )
16571659 self .assertEqual (f"{ '\' ' = } " , "'\\ ''=\" '\" " )
You can’t perform that action at this time.
0 commit comments