time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
-class _BaseYearTest(unittest.TestCase):
- def yearstr(self, y):
- raise NotImplementedError()
-
class _TestAsctimeYear:
_format = '%d'
del skip_if_not_supported
-class _Test4dYear(_BaseYearTest):
+class _Test4dYear:
_format = '%d'
def test_year(self, fmt=None, func=None):
self.assertRaises(OverflowError, self.yearstr, TIME_MINYEAR - 1)
-class TestAsctime4dyear(_TestAsctimeYear, _Test4dYear):
+class TestAsctime4dyear(_TestAsctimeYear, _Test4dYear, unittest.TestCase):
pass
-class TestStrftime4dyear(_TestStrftimeYear, _Test4dYear):
+class TestStrftime4dyear(_TestStrftimeYear, _Test4dYear, unittest.TestCase):
pass
self.assertIs(lt.tm_gmtoff, None)
self.assertIs(lt.tm_zone, None)
-def test_main():
- support.run_unittest(
- TimeTestCase,
- TestLocale,
- TestAsctime4dyear,
- TestStrftime4dyear,
- TestPytime)
if __name__ == "__main__":
- test_main()
+ unittest.main()
- Issue #12820: add tests for the xml.dom.minicompat module.
Patch by John Chandler and Phil Connell.
+- Issue #17690: test_time now works with unittest test discovery.
+ Patch by Zachary Ware.
+
Documentation
-------------