summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-04-11 17:29:42 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-04-11 17:29:42 (GMT)
commit3836d70ed56d4b0f7fab8326470fc8abfe896391 (patch)
tree70bb83f1230f7915a3b4bb34bcee30f99b3fa6e5
parent5e2f59314588f4d263fe728ee8ba7da92f3439a0 (diff)
downloadcpython-3836d70ed56d4b0f7fab8326470fc8abfe896391.zip
cpython-3836d70ed56d4b0f7fab8326470fc8abfe896391.tar.gz
cpython-3836d70ed56d4b0f7fab8326470fc8abfe896391.tar.bz2
#17690: test_time now works with unittest test discovery. Patch by Zachary Ware.
-rw-r--r--Lib/test/test_time.py19
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 15 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 0e4d702..18e0568 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -465,10 +465,6 @@ class TestLocale(unittest.TestCase):
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'
@@ -526,7 +522,7 @@ class _TestStrftimeYear:
del skip_if_not_supported
-class _Test4dYear(_BaseYearTest):
+class _Test4dYear:
_format = '%d'
def test_year(self, fmt=None, func=None):
@@ -559,10 +555,10 @@ class _Test4dYear(_BaseYearTest):
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
@@ -679,13 +675,6 @@ class TestPytime(unittest.TestCase):
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()
diff --git a/Misc/NEWS b/Misc/NEWS
index 3c73b35..b8f687b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -74,6 +74,9 @@ Tests
- 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
-------------