mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[3.9] bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035). (GH-21156)
(cherry picked from commit 700cfa8c90
)
This commit is contained in:
parent
ad7a66731f
commit
f925407a19
23 changed files with 108 additions and 76 deletions
|
@ -488,7 +488,8 @@ class TestCommandLine(unittest.TestCase):
|
|||
with open(TESTFN, 'w') as fd:
|
||||
self.addCleanup(unlink, TESTFN)
|
||||
fd.write("a = 1\n")
|
||||
status, stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
|
||||
status, stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN,
|
||||
PYTHONIOENCODING='utf-8')
|
||||
self.assertIn(b'functions called:', stdout)
|
||||
|
||||
def test_sys_argv_list(self):
|
||||
|
@ -498,7 +499,8 @@ class TestCommandLine(unittest.TestCase):
|
|||
fd.write("print(type(sys.argv))\n")
|
||||
|
||||
status, direct_stdout, stderr = assert_python_ok(TESTFN)
|
||||
status, trace_stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
|
||||
status, trace_stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN,
|
||||
PYTHONIOENCODING='utf-8')
|
||||
self.assertIn(direct_stdout.strip(), trace_stdout)
|
||||
|
||||
def test_count_and_summary(self):
|
||||
|
@ -517,7 +519,8 @@ class TestCommandLine(unittest.TestCase):
|
|||
for i in range(10):
|
||||
f()
|
||||
"""))
|
||||
status, stdout, _ = assert_python_ok('-m', 'trace', '-cs', filename)
|
||||
status, stdout, _ = assert_python_ok('-m', 'trace', '-cs', filename,
|
||||
PYTHONIOENCODING='utf-8')
|
||||
stdout = stdout.decode()
|
||||
self.assertEqual(status, 0)
|
||||
self.assertIn('lines cov% module (path)', stdout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue