(self)
| 1529 | ]) |
| 1530 | |
| 1531 | def test_filename_in_syntaxerror(self): |
| 1532 | # see issue 38964 |
| 1533 | with temp_cwd() as cwd: |
| 1534 | file_path = os.path.join(cwd, 't.py') |
| 1535 | with open(file_path, 'w', encoding="utf-8") as f: |
| 1536 | f.write('f"{a b}"') # This generates a SyntaxError |
| 1537 | _, _, stderr = assert_python_failure(file_path, |
| 1538 | PYTHONIOENCODING='ascii') |
| 1539 | self.assertIn(file_path.encode('ascii', 'backslashreplace'), stderr) |
| 1540 | |
| 1541 | def test_loop(self): |
| 1542 | for i in range(1000): |