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().
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index 747785d..898bcf2 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -9,7 +9,7 @@
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 @@
# 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()