diff options
author | Georg Brandl <georg@python.org> | 2006-07-27 15:05:36 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-07-27 15:05:36 (GMT) |
commit | f102fc5f86bf40695f70888a12d6a8c171bd0515 (patch) | |
tree | 9b3f6f7dfd63c43f0e2c2e4eda7e1070d015943f /Lib | |
parent | 9aed98feb2a58ae17913fae4f40b8ff24ed17aaf (diff) | |
download | cpython-f102fc5f86bf40695f70888a12d6a8c171bd0515.zip cpython-f102fc5f86bf40695f70888a12d6a8c171bd0515.tar.gz cpython-f102fc5f86bf40695f70888a12d6a8c171bd0515.tar.bz2 |
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_defaultdict.py | 6 | ||||
-rw-r--r-- | Lib/test/test_iterlen.py | 8 | ||||
-rw-r--r-- | Lib/test/test_uuid.py | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py index b5a6628..134b5a8 100644 --- a/Lib/test/test_defaultdict.py +++ b/Lib/test/test_defaultdict.py @@ -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() diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py index bcd0a6f..7d2cfb2 100644 --- a/Lib/test/test_iterlen.py +++ b/Lib/test/test_iterlen.py @@ -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() + diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index 9d0d25b..fa7e3f6 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -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() |