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.
This commit is contained in:
Eric Snow 2024-06-07 13:44:56 -04:00 committed by GitHub
parent 242c7498e5
commit e6076d1e13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
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
@ -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

View file

@ -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