-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
It is defined here:
cpython/Lib/test/test_import/__init__.py
Lines 123 to 139 in b407ad3
| def no_rerun(reason): | |
| """Skip rerunning for a particular test. | |
| WARNING: Use this decorator with care; skipping rerunning makes it | |
| impossible to find reference leaks. Provide a clear reason for skipping the | |
| test using the 'reason' parameter. | |
| """ | |
| def deco(func): | |
| _has_run = False | |
| def wrapper(self): | |
| nonlocal _has_run | |
| if _has_run: | |
| self.skipTest(reason) | |
| func(self) | |
| _has_run = True | |
| return wrapper | |
| return deco |
and here:
cpython/Lib/test/datetimetester.py
Lines 50 to 68 in b407ad3
| # This is copied from test_import/__init__.py. | |
| # XXX Move it to support/__init__.py. | |
| def no_rerun(reason): | |
| """Skip rerunning for a particular test. | |
| WARNING: Use this decorator with care; skipping rerunning makes it | |
| impossible to find reference leaks. Provide a clear reason for skipping the | |
| test using the 'reason' parameter. | |
| """ | |
| def deco(func): | |
| _has_run = False | |
| def wrapper(self): | |
| nonlocal _has_run | |
| if _has_run: | |
| self.skipTest(reason) | |
| func(self) | |
| _has_run = True | |
| return wrapper | |
| return deco |
Introduced in #119373
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement