Skip to content

Commit b53ad21

Browse files
committed
Add test
1 parent 0a39730 commit b53ad21

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/test/test_py_compile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ def test_bad_syntax_with_quiet(self):
327327
self.assertEqual(stdout, b'')
328328
self.assertEqual(stderr, b'')
329329

330+
def test_bad_syntax_stderr_ends_with_newline(self):
331+
with open(self.source_path, 'w') as file:
332+
file.write(' print("hello world")\n')
333+
rc, stdout, stderr = self.pycompilecmd_failure(self.source_path)
334+
self.assertTrue(stderr.endswith(b'\n'))
335+
330336
def test_file_not_exists(self):
331337
should_not_exists = os.path.join(os.path.dirname(__file__), 'should_not_exists.py')
332338
rc, stdout, stderr = self.pycompilecmd_failure(self.source_path, should_not_exists)

0 commit comments

Comments
 (0)