mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
This commit is contained in:
parent
8ea6353f60
commit
700cfa8c90
24 changed files with 110 additions and 77 deletions
|
@ -30,16 +30,18 @@ class TestPathfixFunctional(unittest.TestCase):
|
|||
with open(filename, 'w', encoding='utf8') as f:
|
||||
f.write(f'{shebang}\n' + 'print("Hello world")\n')
|
||||
|
||||
encoding = sys.getfilesystemencoding()
|
||||
proc = subprocess.run(
|
||||
[sys.executable, self.script,
|
||||
*pathfix_flags, '-n', pathfix_arg],
|
||||
capture_output=True, text=1)
|
||||
env={**os.environ, 'PYTHONIOENCODING': encoding},
|
||||
capture_output=True)
|
||||
|
||||
if stdout == '' and proc.returncode == 0:
|
||||
stdout = f'{filename}: updating\n'
|
||||
self.assertEqual(proc.returncode, exitcode, proc)
|
||||
self.assertEqual(proc.stdout, stdout, proc)
|
||||
self.assertEqual(proc.stderr, stderr, proc)
|
||||
self.assertEqual(proc.stdout.decode(encoding), stdout.replace('\n', os.linesep), proc)
|
||||
self.assertEqual(proc.stderr.decode(encoding), stderr.replace('\n', os.linesep), proc)
|
||||
|
||||
with open(filename, 'r', encoding='utf8') as f:
|
||||
output = f.read()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue