diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-03 16:47:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 16:47:42 (GMT) |
commit | bb0424b122e3d222a558bd4177ce37befd3e0347 (patch) | |
tree | f5962e6276319558e48b702b6fa5a48f5c03ff6b /Lib/test/test_embed.py | |
parent | a7f5d93bb6906d0f999248b47295d3a59b130f4d (diff) | |
download | cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.zip cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.tar.gz cpython-bb0424b122e3d222a558bd4177ce37befd3e0347.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r-- | Lib/test/test_embed.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 2b74052..31dc39f 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1,5 +1,7 @@ # Run the tests in Programs/_testembed.c (tests for the CPython embedding APIs) from test import support +from test.support import import_helper +from test.support import os_helper import unittest from collections import namedtuple @@ -1339,8 +1341,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): # # The global path configuration (_Py_path_config) must be a copy # of the path configuration of PyInterpreter.config (PyConfig). - ctypes = support.import_module('ctypes') - _testinternalcapi = support.import_module('_testinternalcapi') + ctypes = import_helper.import_module('ctypes') + _testinternalcapi = import_helper.import_module('_testinternalcapi') def get_func(name): func = getattr(ctypes.pythonapi, name) @@ -1418,7 +1420,7 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase): returncode=1) def test_audit_run_interactivehook(self): - startup = os.path.join(self.oldcwd, support.TESTFN) + ".py" + startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py" with open(startup, "w", encoding="utf-8") as f: print("import sys", file=f) print("sys.__interactivehook__ = lambda: None", file=f) @@ -1431,7 +1433,7 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase): os.unlink(startup) def test_audit_run_startup(self): - startup = os.path.join(self.oldcwd, support.TESTFN) + ".py" + startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py" with open(startup, "w", encoding="utf-8") as f: print("pass", file=f) try: |