summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authorUtkarsh Upadhyay <mail@musicallyut.in>2017-07-02 12:46:04 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-07-02 12:46:04 (GMT)
commit98b6bc3bf72532b784a1c1fa76eaa6026a663e44 (patch)
tree71c47739cd897b13df0ba1086470f9cd0f1eebb0 /Lib/test/datetimetester.py
parent8a8d28501fc8ce25926d168f1c657656c809fd4c (diff)
downloadcpython-98b6bc3bf72532b784a1c1fa76eaa6026a663e44.zip
cpython-98b6bc3bf72532b784a1c1fa76eaa6026a663e44.tar.gz
cpython-98b6bc3bf72532b784a1c1fa76eaa6026a663e44.tar.bz2
bpo-30822: Fix testing of datetime module. (#2530)
Only C implementation was tested.
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index bccd97a..b25e6c1 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -61,8 +61,9 @@ class TestModule(unittest.TestCase):
self.assertEqual(datetime.MAXYEAR, 9999)
def test_name_cleanup(self):
- if '_Fast' not in str(self):
- return
+ if '_Pure' in self.__class__.__name__:
+ self.skipTest('Only run for Fast C implementation')
+
datetime = datetime_module
names = set(name for name in dir(datetime)
if not name.startswith('__') and not name.endswith('__'))
@@ -72,8 +73,9 @@ class TestModule(unittest.TestCase):
self.assertEqual(names - allowed, set([]))
def test_divide_and_round(self):
- if '_Fast' in str(self):
- return
+ if '_Fast' in self.__class__.__name__:
+ self.skipTest('Only run for Pure Python implementation')
+
dar = datetime_module._divide_and_round
self.assertEqual(dar(-10, -3), 3)
@@ -2851,7 +2853,7 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
self.assertRaises(TypeError, t.strftime, "%Z")
# Issue #6697:
- if '_Fast' in str(self):
+ if '_Fast' in self.__class__.__name__:
Badtzname.tz = '\ud800'
self.assertRaises(ValueError, t.strftime, "%Z")