File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 15
15
import types
16
16
import decimal
17
17
import unittest
18
+ import warnings
18
19
from test import support
19
20
from test .support .os_helper import temp_cwd
20
21
from test .support .script_helper import assert_python_failure , assert_python_ok
@@ -1650,8 +1651,9 @@ def __repr__(self):
1650
1651
#self.assertEqual(f'X{x = }Y', 'Xx\t=\t'+repr(x)+'Y')
1651
1652
1652
1653
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}\' ' )
1655
1657
self .assertEqual (f'{ r"\xff" = } ' , 'r"\\ xff"=\' \\ \\ xff\' ' )
1656
1658
self .assertEqual (f'{ r"\n" = } ' , 'r"\\ n"=\' \\ \\ n\' ' )
1657
1659
self .assertEqual (f"{ '\' ' = } " , "'\\ ''=\" '\" " )
You can’t perform that action at this time.
0 commit comments