mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)
* Move Lib/unittest/test/ to Lib/test/test_unittest/ * Remove Lib/test/test_unittest.py * Replace unittest.test with test.test_unittest * Remove unittest.load_tests() * Rewrite unittest __init__.py and __main__.py * Update build system, CODEOWNERS, and wasm_assets.py
This commit is contained in:
parent
d82e0bfe8b
commit
c735d54534
38 changed files with 77 additions and 137 deletions
17
Lib/test/test_unittest/testmock/__init__.py
Normal file
17
Lib/test/test_unittest/testmock/__init__.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
here = os.path.dirname(__file__)
|
||||
loader = unittest.defaultTestLoader
|
||||
|
||||
def load_tests(*args):
|
||||
suite = unittest.TestSuite()
|
||||
for fn in os.listdir(here):
|
||||
if fn.startswith("test") and fn.endswith(".py"):
|
||||
modname = "test.test_unittest.testmock." + fn[:-3]
|
||||
__import__(modname)
|
||||
module = sys.modules[modname]
|
||||
suite.addTest(loader.loadTestsFromModule(module))
|
||||
return suite
|
Loading…
Add table
Add a link
Reference in a new issue