[Python-checkins] r50861 - python/trunk/Lib/test/test_defaultdict.py python/trunk/Lib/test/test_iterlen.py python/trunk/Lib/test/test_uuid.py

georg.brandl python-checkins at python.org
Thu Jul 27 17:05:37 CEST 2006


Author: georg.brandl
Date: Thu Jul 27 17:05:36 2006
New Revision: 50861

Modified:
   python/trunk/Lib/test/test_defaultdict.py
   python/trunk/Lib/test/test_iterlen.py
   python/trunk/Lib/test/test_uuid.py
Log:
Add test_main() methods. These three tests were never run
by regrtest.py.

We really need a simpler testing framework.



Modified: python/trunk/Lib/test/test_defaultdict.py
==============================================================================
--- python/trunk/Lib/test/test_defaultdict.py	(original)
+++ python/trunk/Lib/test/test_defaultdict.py	Thu Jul 27 17:05:36 2006
@@ -4,6 +4,7 @@
 import copy
 import tempfile
 import unittest
+from test import test_support
 
 from collections import defaultdict
 
@@ -131,5 +132,8 @@
         self.assertEqual(d2, d1)
 
 
+def test_main():
+    test_support.run_unittest(TestDefaultDict)
+
 if __name__ == "__main__":
-    unittest.main()
+    test_main()

Modified: python/trunk/Lib/test/test_iterlen.py
==============================================================================
--- python/trunk/Lib/test/test_iterlen.py	(original)
+++ python/trunk/Lib/test/test_iterlen.py	Thu Jul 27 17:05:36 2006
@@ -235,9 +235,7 @@
         self.assertEqual(len(it), 0)
 
 
-
-if __name__ == "__main__":
-
+def test_main():
     unittests = [
         TestRepeat,
         TestXrange,
@@ -255,3 +253,7 @@
         TestSeqIterReversed,
     ]
     test_support.run_unittest(*unittests)
+
+if __name__ == "__main__":
+    test_main()
+

Modified: python/trunk/Lib/test/test_uuid.py
==============================================================================
--- python/trunk/Lib/test/test_uuid.py	(original)
+++ python/trunk/Lib/test/test_uuid.py	Thu Jul 27 17:05:36 2006
@@ -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 @@
             equal(u, uuid.UUID(v))
             equal(str(u), v)
 
+
+def test_main():
+    test_support.run_unittest(TestUUID)
+
 if __name__ == '__main__':
-    main()
+    test_main()


More information about the Python-checkins mailing list