(self)
| 1514 | ]) |
| 1515 | |
| 1516 | def test_filename_in_syntaxerror(self): |
| 1517 | # see issue 38964 |
| 1518 | with temp_cwd() as cwd: |
| 1519 | file_path = os.path.join(cwd, 't.py') |
| 1520 | with open(file_path, 'w', encoding="utf-8") as f: |
| 1521 | f.write('f"{a b}"') # This generates a SyntaxError |
| 1522 | _, _, stderr = assert_python_failure(file_path, |
| 1523 | PYTHONIOENCODING='ascii') |
| 1524 | self.assertIn(file_path.encode('ascii', 'backslashreplace'), stderr) |
| 1525 | |
| 1526 | def test_loop(self): |
| 1527 | for i in range(1000): |