8000 gh-117398: Add multiphase support to _datetime by erlend-aasland · Pull Request #119373 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117398: Add multiphase support to _datetime #119373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Copy no_rerun().
  • Loading branch information
ericsnowcurrently authored May 27, 2024
commit 90ff7d6835449afa4a5a11a196aa7dee2801d983
21 changes: 20 additions & 1 deletion Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from test import support
from test.support import is_resource_enabled, ALWAYS_EQ, LARGEST, SMALLEST
from test.support import warnings_helper
from test.test_import import no_rerun

import datetime as datetime_module
from datetime import MINYEAR, MAXYEAR
Expand All @@ -48,6 +47,26 @@
pass
#

# 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

pickle_loads = {pickle.loads, pickle._loads}

pickle_choices = [(pickle, pickle, proto)
Expand Down
0