mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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:
parent
0d4c06e06e
commit
c2898c5a67
29 changed files with 87 additions and 180 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue