mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-67224: Show source lines in tracebacks when using the -c option when running Python (#111200)
This commit is contained in:
parent
3f84a19e62
commit
90a1b2859f
13 changed files with 104 additions and 36 deletions
|
@ -1769,9 +1769,9 @@ class RunFuncTestCase(BaseTestCase):
|
|||
cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", code],
|
||||
capture_output=True)
|
||||
lines = cp.stderr.splitlines()
|
||||
self.assertEqual(len(lines), 2, lines)
|
||||
self.assertEqual(len(lines), 4, lines)
|
||||
self.assertTrue(lines[0].startswith(b"<string>:2: EncodingWarning: "))
|
||||
self.assertTrue(lines[1].startswith(b"<string>:3: EncodingWarning: "))
|
||||
self.assertTrue(lines[2].startswith(b"<string>:3: EncodingWarning: "))
|
||||
|
||||
|
||||
def _get_test_grp_name():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue