Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4849a80

Browse files
gh-102251: Disable non-rerunnable test in test_import (#106013)
1 parent8ef0ee4 commit4849a80

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

‎Lib/test/test_import/__init__.py‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ def remove_files(name):
107107
rmtree('__pycache__')
108108

109109

110+
defno_rerun(reason):
111+
"""Skip rerunning for a particular test.
112+
113+
WARNING: Use this decorator with care; skipping rerunning makes it
114+
impossible to find reference leaks. Provide a clear reason for skipping the
115+
test using the 'reason' parameter.
116+
"""
117+
defdeco(func):
118+
_has_run=False
119+
defwrapper(self):
120+
nonlocal_has_run
121+
if_has_run:
122+
self.skipTest(reason)
123+
func(self)
124+
_has_run=True
125+
returnwrapper
126+
returndeco
127+
128+
110129
@contextlib.contextmanager
111130
def_ready_to_import(name=None,source=""):
112131
# sets up a temporary directory and removes it
@@ -1989,10 +2008,6 @@ class SinglephaseInitTests(unittest.TestCase):
19892008

19902009
@classmethod
19912010
defsetUpClass(cls):
1992-
if'-R'insys.argvor'--huntrleaks'insys.argv:
1993-
# https://github.com/python/cpython/issues/102251
1994-
raiseunittest.SkipTest('unresolved refleaks (see gh-102251)')
1995-
19962011
spec=importlib.util.find_spec(cls.NAME)
19972012
fromimportlib.machineryimportExtensionFileLoader
19982013
cls.FILE=spec.origin
@@ -2502,6 +2517,7 @@ def test_basic_multiple_interpreters_main_no_reset(self):
25022517
# * m_copy was copied from interp2 (was from interp1)
25032518
# * module's global state was updated, not reset
25042519

2520+
@no_rerun(reason="rerun not possible; module state is never cleared (see gh-102251)")
25052521
@requires_subinterpreters
25062522
deftest_basic_multiple_interpreters_deleted_no_reset(self):
25072523
# without resetting; already loaded in a deleted interpreter

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp