bpo-40275: Use new test.support helper submodules in tests (GH-21451)
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 @@
#
# 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 @@
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 @@
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: