mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
This commit is contained in:
parent
a7f5d93bb6
commit
bb0424b122
20 changed files with 324 additions and 278 deletions
|
@ -10,6 +10,7 @@ import sys
|
|||
import sysconfig
|
||||
import test.support
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
from test.support.script_helper import assert_python_ok, assert_python_failure
|
||||
from test.support import threading_helper
|
||||
import textwrap
|
||||
|
@ -632,7 +633,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
out = p.communicate()[0].strip()
|
||||
self.assertEqual(out, b'\xbd')
|
||||
|
||||
@unittest.skipUnless(test.support.FS_NONASCII,
|
||||
@unittest.skipUnless(os_helper.FS_NONASCII,
|
||||
'requires OS support of non-ASCII encodings')
|
||||
@unittest.skipUnless(sys.getfilesystemencoding() == locale.getpreferredencoding(False),
|
||||
'requires FS encoding to match locale')
|
||||
|
@ -641,10 +642,10 @@ class SysModuleTest(unittest.TestCase):
|
|||
|
||||
env["PYTHONIOENCODING"] = ""
|
||||
p = subprocess.Popen([sys.executable, "-c",
|
||||
'print(%a)' % test.support.FS_NONASCII],
|
||||
'print(%a)' % os_helper.FS_NONASCII],
|
||||
stdout=subprocess.PIPE, env=env)
|
||||
out = p.communicate()[0].strip()
|
||||
self.assertEqual(out, os.fsencode(test.support.FS_NONASCII))
|
||||
self.assertEqual(out, os.fsencode(os_helper.FS_NONASCII))
|
||||
|
||||
@unittest.skipIf(sys.base_prefix != sys.prefix,
|
||||
'Test is not venv-compatible')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue