bpo-40275: Use new test.support helper submodules in tests (GH-20849)

This commit is contained in:
Hai Shi 2020-06-25 18:38:51 +08:00 committed by GitHub
parent 5f190d2cc6
commit f7ba40b505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 78 additions and 60 deletions

View file

@ -6,6 +6,7 @@ import unittest
from unittest import mock
from test import support
from test.support import os_helper
class PlatformTest(unittest.TestCase):
@ -17,7 +18,7 @@ class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
@support.skip_unless_symlink
@os_helper.skip_unless_symlink
def test_architecture_via_symlink(self): # issue3762
with support.PythonSymlink() as py:
cmd = "-c", "import platform; print(platform.architecture())"
@ -281,8 +282,8 @@ class PlatformTest(unittest.TestCase):
executable = sys.executable
platform.libc_ver(executable)
filename = support.TESTFN
self.addCleanup(support.unlink, filename)
filename = os_helper.TESTFN
self.addCleanup(os_helper.unlink, filename)
with mock.patch('os.confstr', create=True, return_value='mock 1.0'):
# test os.confstr() code path