diff options
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index e87eede..25d3eec 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -851,13 +851,19 @@ class IgnoreEnvironmentTest(unittest.TestCase): ) class SyntaxErrorTests(unittest.TestCase): - def test_tokenizer_error_with_stdin(self): - proc = subprocess.run([sys.executable, "-"], input = b"(1+2+3", + def check_string(self, code): + proc = subprocess.run([sys.executable, "-"], input=code, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.assertNotEqual(proc.returncode, 0) self.assertNotEqual(proc.stderr, None) self.assertIn(b"\nSyntaxError", proc.stderr) + def test_tokenizer_error_with_stdin(self): + self.check_string(b"(1+2+3") + + def test_decoding_error_at_the_end_of_the_line(self): + self.check_string(b"'\u1f'") + def test_main(): support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests) support.reap_children() |