Skip to content

Commit

Permalink
gh-93839: Use load_package_tests() for testmock (GH-94055)
Browse files Browse the repository at this point in the history
Fixes failing tests on WebAssembly platforms.

Automerge-Triggered-By: GH:tiran
  • Loading branch information
tiran authored Jun 21, 2022
1 parent 0ff7b99 commit 50ebd72
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions Lib/test/test_unittest/testmock/__init__.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 50ebd72

Please sign in to comment.