Skip to content

Commit

Permalink
pythongh-119659: Get the datetime CAPI Tests Running Again (pythongh-…
Browse files Browse the repository at this point in the history
…120180)

The tests were accidentally disabled by 2da0dc0, which didn't handle classes correctly.

I considered updating no_rerun() to support classes, but the way test_datetime.py works would have made things fairly messy.  Plus, it looks like the refleaks we had encountered before have been resolved.
  • Loading branch information
ericsnowcurrently authored and noahbkim committed Jul 11, 2024
1 parent cca3601 commit eb8b713
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from test import support
from test.support import is_resource_enabled, ALWAYS_EQ, LARGEST, SMALLEST
from test.support import warnings_helper, no_rerun
from test.support import warnings_helper

import datetime as datetime_module
from datetime import MINYEAR, MAXYEAR
Expand Down Expand Up @@ -6385,7 +6385,6 @@ class IranTest(ZoneInfoTest):


@unittest.skipIf(_testcapi is None, 'need _testcapi module')
@no_rerun("the encapsulated datetime C API does not support reloading")
class CapiTest(unittest.TestCase):
def setUp(self):
# Since the C API is not present in the _Pure tests, skip all tests
Expand Down
1 change: 1 addition & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ def no_rerun(reason):
test using the 'reason' parameter.
"""
def deco(func):
assert not isinstance(func, type), func
_has_run = False
def wrapper(self):
nonlocal _has_run
Expand Down

0 comments on commit eb8b713

Please sign in to comment.