mirror of
https://github.com/python/cpython.git
synced 2025-07-14 14:55:17 +00:00

* 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
18 lines
628 B
Python
18 lines
628 B
Python
import os
|
|
import unittest
|
|
|
|
|
|
def load_tests(loader, standard_tests, pattern):
|
|
# top level directory cached on loader instance
|
|
this_dir = os.path.dirname(__file__)
|
|
pattern = pattern or "test*.py"
|
|
# We are inside test.test_unittest.testmock, so the top-level is three notches up
|
|
top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))
|
|
package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
|
|
top_level_dir=top_level_dir)
|
|
standard_tests.addTests(package_tests)
|
|
return standard_tests
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|