Commit f102fc5f authored by Georg Brandl's avatar Georg Brandl

Add test_main() methods. These three tests were never run

by regrtest.py.

We really need a simpler testing framework.
parent 9aed98fe
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import copy import copy
import tempfile import tempfile
import unittest import unittest
from test import test_support
from collections import defaultdict from collections import defaultdict
...@@ -131,5 +132,8 @@ class TestDefaultDict(unittest.TestCase): ...@@ -131,5 +132,8 @@ class TestDefaultDict(unittest.TestCase):
self.assertEqual(d2, d1) self.assertEqual(d2, d1)
def test_main():
test_support.run_unittest(TestDefaultDict)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() test_main()
...@@ -235,9 +235,7 @@ class TestSeqIterReversed(TestInvariantWithoutMutations): ...@@ -235,9 +235,7 @@ class TestSeqIterReversed(TestInvariantWithoutMutations):
self.assertEqual(len(it), 0) self.assertEqual(len(it), 0)
def test_main():
if __name__ == "__main__":
unittests = [ unittests = [
TestRepeat, TestRepeat,
TestXrange, TestXrange,
...@@ -255,3 +253,7 @@ if __name__ == "__main__": ...@@ -255,3 +253,7 @@ if __name__ == "__main__":
TestSeqIterReversed, TestSeqIterReversed,
] ]
test_support.run_unittest(*unittests) test_support.run_unittest(*unittests)
if __name__ == "__main__":
test_main()
from unittest import TestCase, main from unittest import TestCase
from test import test_support
import uuid import uuid
def importable(name): def importable(name):
...@@ -392,5 +393,9 @@ class TestUUID(TestCase): ...@@ -392,5 +393,9 @@ class TestUUID(TestCase):
equal(u, uuid.UUID(v)) equal(u, uuid.UUID(v))
equal(str(u), v) equal(str(u), v)
def test_main():
test_support.run_unittest(TestUUID)
if __name__ == '__main__': if __name__ == '__main__':
main() test_main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment