Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().

This commit is contained in:
Collin Winter 2007-04-25 17:29:52 +00:00
parent 0d4c06e06e
commit c2898c5a67
29 changed files with 87 additions and 180 deletions

View file

@ -9,7 +9,7 @@ import tempfile
import unittest
import threading
from contextlib import * # Tests __all__
from test.test_support import run_suite
from test import test_support
class ContextManagerTestCase(unittest.TestCase):
@ -332,9 +332,7 @@ class LockContextTestCase(unittest.TestCase):
# This is needed to make the test actually run under regrtest.py!
def test_main():
run_suite(
unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__])
)
test_support.run_unittest(__name__)
if __name__ == "__main__":
test_main()