]> granicus.if.org Git - python/commitdiff
Add test_main() methods. These three tests were never run
authorGeorg Brandl <georg@python.org>
Thu, 27 Jul 2006 15:05:36 +0000 (15:05 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 27 Jul 2006 15:05:36 +0000 (15:05 +0000)
by regrtest.py.

We really need a simpler testing framework.

Lib/test/test_defaultdict.py
Lib/test/test_iterlen.py
Lib/test/test_uuid.py

index b5a662898767b132edc48116b9f81faaa837ea00..134b5a8cb2fafd905bd8e61eee04aad41da6c120 100644 (file)
@@ -4,6 +4,7 @@ import os
 import copy
 import tempfile
 import unittest
+from test import test_support
 
 from collections import defaultdict
 
@@ -131,5 +132,8 @@ class TestDefaultDict(unittest.TestCase):
         self.assertEqual(d2, d1)
 
 
+def test_main():
+    test_support.run_unittest(TestDefaultDict)
+
 if __name__ == "__main__":
-    unittest.main()
+    test_main()
index bcd0a6f4c2a79cc69fff9b32d968bb3262b83614..7d2cfb23600aacfe3fa8b42c10443f8a5e5ec983 100644 (file)
@@ -235,9 +235,7 @@ class TestSeqIterReversed(TestInvariantWithoutMutations):
         self.assertEqual(len(it), 0)
 
 
-
-if __name__ == "__main__":
-
+def test_main():
     unittests = [
         TestRepeat,
         TestXrange,
@@ -255,3 +253,7 @@ if __name__ == "__main__":
         TestSeqIterReversed,
     ]
     test_support.run_unittest(*unittests)
+
+if __name__ == "__main__":
+    test_main()
+
index 9d0d25b763d2b255b607b1e962edc8a4e381b3f4..fa7e3f61f85171e4d3b7ea9a6b3264f5709b1039 100644 (file)
@@ -1,4 +1,5 @@
-from unittest import TestCase, main
+from unittest import TestCase
+from test import test_support
 import uuid
 
 def importable(name):
@@ -392,5 +393,9 @@ class TestUUID(TestCase):
             equal(u, uuid.UUID(v))
             equal(str(u), v)
 
+
+def test_main():
+    test_support.run_unittest(TestUUID)
+
 if __name__ == '__main__':
-    main()
+    test_main()