(self)
| 1003 | self.assertEqual(f'\\\N{AMPERSAND}', '\\&') |
| 1004 | |
| 1005 | def test_misformed_unicode_character_name(self): |
| 1006 | # These test are needed because unicode names are parsed |
| 1007 | # differently inside f-strings. |
| 1008 | self.assertAllRaise(SyntaxError, r"\(unicode error\) 'unicodeescape' codec can't decode bytes in position .*: malformed \\N character escape", |
| 1009 | [r"f'\N'", |
| 1010 | r"f'\N '", |
| 1011 | r"f'\N '", # See bpo-46503. |
| 1012 | r"f'\N{'", |
| 1013 | r"f'\N{GREEK CAPITAL LETTER DELTA'", |
| 1014 | |
| 1015 | # Here are the non-f-string versions, |
| 1016 | # which should give the same errors. |
| 1017 | r"'\N'", |
| 1018 | r"'\N '", |
| 1019 | r"'\N '", |
| 1020 | r"'\N{'", |
| 1021 | r"'\N{GREEK CAPITAL LETTER DELTA'", |
| 1022 | ]) |
| 1023 | |
| 1024 | def test_backslashes_in_expression_part(self): |
| 1025 | self.assertEqual(f"{( |
nothing calls this directly
no test coverage detected