mirror of https://github.com/python/cpython
Add test_main() methods. These three tests were never run
by regrtest.py. We really need a simpler testing framework.
This commit is contained in:
parent
9aed98feb2
commit
f102fc5f86
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue