summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authorUtkarsh Upadhyay <mail@musicallyut.in>2017-07-26 11:49:16 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-07-26 11:49:16 (GMT)
commitc52cea49544621b612c7f17f45a0c2b8b61a6c67 (patch)
tree523ddcf1b1a8e0d9a101c1cf9e3b1013cf698c1d /Lib/test/datetimetester.py
parent0dbfab2ac7398d5d8f7e93a024a3bc866f5dd472 (diff)
downloadcpython-c52cea49544621b612c7f17f45a0c2b8b61a6c67.zip
cpython-c52cea49544621b612c7f17f45a0c2b8b61a6c67.tar.gz
cpython-c52cea49544621b612c7f17f45a0c2b8b61a6c67.tar.bz2
[3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) (#2816)
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) Only C implementation was tested. (cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75) * [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) Only C implementation was tested.. (cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75)
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")