(self)
| 49 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 50 | @force_not_colorized |
| 51 | def test_EOFS_with_file(self): |
| 52 | expect = ("(<string>, line 1)") |
| 53 | with os_helper.temp_dir() as temp_dir: |
| 54 | file_name = script_helper.make_script(temp_dir, 'foo', |
| 55 | """ä = '''thîs is \na \ntest""") |
| 56 | rc, out, err = script_helper.assert_python_failure('-X', 'utf8', file_name) |
| 57 | err = err.decode().splitlines() |
| 58 | self.assertEqual(err[-3:], [ |
| 59 | " ä = '''thîs is ", |
| 60 | ' ^', |
| 61 | 'SyntaxError: unterminated triple-quoted string literal (detected at line 3)']) |
| 62 | |
| 63 | file_name = script_helper.make_script(temp_dir, 'foo', |
| 64 | """ä = '''thîs is \na \ntest""".encode()) |
| 65 | rc, out, err = script_helper.assert_python_failure('-X', 'utf8', file_name) |
| 66 | err = err.decode().splitlines() |
| 67 | self.assertEqual(err[-3:], [ |
| 68 | " ä = '''thîs is ", |
| 69 | ' ^', |
| 70 | 'SyntaxError: unterminated triple-quoted string literal (detected at line 3)']) |
| 71 | |
| 72 | file_name = script_helper.make_script(temp_dir, 'foo', |
| 73 | BOM_UTF8 + """ä = '''thîs is \na \ntest""".encode()) |
| 74 | rc, out, err = script_helper.assert_python_failure('-X', 'utf8', file_name) |
| 75 | err = err.decode().splitlines() |
| 76 | self.assertEqual(err[-3:], [ |
| 77 | " ä = '''thîs is ", |
| 78 | ' ^', |
| 79 | 'SyntaxError: unterminated triple-quoted string literal (detected at line 3)']) |
| 80 | |
| 81 | file_name = script_helper.make_script(temp_dir, 'foo', |
| 82 | """# coding: latin1\nä = '''thîs is \na \ntest""".encode('latin1')) |
| 83 | rc, out, err = script_helper.assert_python_failure('-X', 'utf8', file_name) |
| 84 | err = err.decode().splitlines() |
| 85 | self.assertEqual(err[-3:], [ |
| 86 | " ä = '''thîs is ", |
| 87 | ' ^', |
| 88 | 'SyntaxError: unterminated triple-quoted string literal (detected at line 4)']) |
| 89 | |
| 90 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 91 | @warnings_helper.ignore_warnings(category=SyntaxWarning) |
nothing calls this directly
no test coverage detected