summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index b3838d5..ba7f185 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -47,6 +47,26 @@ except ImportError:
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)
@@ -6383,6 +6403,7 @@ 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