[3.5] bpo-30822: Fix testing of datetime module. (GH-2530) by musically-ut · Pull Request #2550 · python/cpython
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('__'))
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)
# Issue #6697: if '_Fast' in str(self): if '_Fast' in self.__class__.__name__: Badtzname.tz = '\ud800' self.assertRaises(ValueError, t.strftime, "%Z")