Skip to content

Refactor: move no_rerun from test_import and datetimetester to test.support#119659

@sobolevn

Description

@sobolevn

Feature or enhancement

It is defined here:

defno_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.
"""
defdeco(func):
_has_run=False
defwrapper(self):
nonlocal_has_run
if_has_run:
self.skipTest(reason)
func(self)
_has_run=True
returnwrapper
returndeco

and here:

# This is copied from test_import/__init__.py.
# XXX Move it to support/__init__.py.
defno_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.
"""
defdeco(func):
_has_run=False
defwrapper(self):
nonlocal_has_run
if_has_run:
self.skipTest(reason)
func(self)
_has_run=True
returnwrapper
returndeco

Introduced in #119373

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions