We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94eeac0 commit 4b3670cCopy full SHA for 4b3670c
Lib/test/test_unittest/testmock/__init__.py
@@ -1,17 +1,6 @@
1
-import os
2
-import sys
3
-import unittest
+import os.path
+from test.support import load_package_tests
4
5
6
-here = os.path.dirname(__file__)
7
-loader = unittest.defaultTestLoader
8
-
9
def load_tests(*args):
10
- suite = unittest.TestSuite()
11
- for fn in os.listdir(here):
12
- if fn.startswith("test") and fn.endswith(".py"):
13
- modname = "test.test_unittest.testmock." + fn[:-3]
14
- __import__(modname)
15
- module = sys.modules[modname]
16
- suite.addTest(loader.loadTestsFromModule(module))
17
- return suite
+ return load_package_tests(os.path.dirname(__file__), *args)
0 commit comments