mirror of
https://github.com/python/cpython
synced 2024-09-16 01:31:10 +00:00
gh-93839: Use load_package_tests() for testmock (GH-94055)
Fixes failing tests on WebAssembly platforms. Automerge-Triggered-By: GH:tiran
This commit is contained in:
parent
0ff7b996f5
commit
50ebd72fb0
|
@ -1,17 +1,6 @@
|
|||
import os
|
||||
import sys
|
||||
import unittest
|
||||
import os.path
|
||||
from test.support import load_package_tests
|
||||
|
||||
|
||||
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
|
||||
return load_package_tests(os.path.dirname(__file__), *args)
|
||||
|
|
Loading…
Reference in a new issue