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

Commitf6fc831

Browse files
[3.12]gh-102251: Disable non-rerunnable test in test_import (GH-106013) (#109540)
gh-102251: Disable non-rerunnable test in test_import (GH-106013)(cherry picked from commit4849a80)Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
1 parentfbf703c commitf6fc831

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
@@ -106,6 +106,25 @@ def remove_files(name):
106106
rmtree('__pycache__')
107107

108108

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

20192038
@classmethod
20202039
defsetUpClass(cls):
2021-
if'-R'insys.argvor'--huntrleaks'insys.argv:
2022-
# https://github.com/python/cpython/issues/102251
2023-
raiseunittest.SkipTest('unresolved refleaks (see gh-102251)')
2024-
20252040
spec=importlib.util.find_spec(cls.NAME)
20262041
fromimportlib.machineryimportExtensionFileLoader
20272042
cls.FILE=spec.origin
@@ -2535,6 +2550,7 @@ def test_basic_multiple_interpreters_main_no_reset(self):
25352550
# * m_copy was copied from interp2 (was from interp1)
25362551
# * module's global state was updated, not reset
25372552

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp