mirror of
https://github.com/python/cpython.git
synced 2025-09-25 01:43:11 +00:00
gh-109625: Move _ready_to_import() from test_import to support.import_helper (#109626)
This commit is contained in:
parent
712cb173f8
commit
115c49ad5a
3 changed files with 35 additions and 34 deletions
|
@ -33,7 +33,7 @@ except ImportError:
|
|||
|
||||
from test.support import cpython_only
|
||||
from test.support import MISSING_C_DOCSTRINGS, ALWAYS_EQ
|
||||
from test.support.import_helper import DirsOnSysPath
|
||||
from test.support.import_helper import DirsOnSysPath, ready_to_import
|
||||
from test.support.os_helper import TESTFN
|
||||
from test.support.script_helper import assert_python_ok, assert_python_failure
|
||||
from test import inspect_fodder as mod
|
||||
|
@ -43,8 +43,6 @@ from test import inspect_stock_annotations
|
|||
from test import inspect_stringized_annotations
|
||||
from test import inspect_stringized_annotations_2
|
||||
|
||||
from test.test_import import _ready_to_import
|
||||
|
||||
|
||||
# Functions tested in this suite:
|
||||
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
|
||||
|
@ -4954,7 +4952,7 @@ def foo():
|
|||
|
||||
def test_getsource_reload(self):
|
||||
# see issue 1218234
|
||||
with _ready_to_import('reload_bug', self.src_before) as (name, path):
|
||||
with ready_to_import('reload_bug', self.src_before) as (name, path):
|
||||
module = importlib.import_module(name)
|
||||
self.assertInspectEqual(path, module)
|
||||
with open(path, 'w', encoding='utf-8') as src:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue