Skip to content

Commit e6076d1

Browse files
gh-119659: Get the datetime CAPI Tests Running Again (gh-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.
1 parent 242c749 commit e6076d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/datetimetester.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from test import support
2424
from test.support import is_resource_enabled, ALWAYS_EQ, LARGEST, SMALLEST
25-
from test.support import warnings_helper, no_rerun
25+
from test.support import warnings_helper
2626

2727
import datetime as datetime_module
2828
from datetime import MINYEAR, MAXYEAR
@@ -6385,7 +6385,6 @@ class IranTest(ZoneInfoTest):
63856385

63866386

63876387
@unittest.skipIf(_testcapi is None, 'need _testcapi module')
6388-
@no_rerun("the encapsulated datetime C API does not support reloading")
63896388
class CapiTest(unittest.TestCase):
63906389
def setUp(self):
63916390
# Since the C API is not present in the _Pure tests, skip all tests

Lib/test/support/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ def no_rerun(reason):
11971197
test using the 'reason' parameter.
11981198
"""
11991199
def deco(func):
1200+
assert not isinstance(func, type), func
12001201
_has_run = False
12011202
def wrapper(self):
12021203
nonlocal _has_run

0 commit comments

Comments
 (0)