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 unittest.test.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()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 146 B | 0644 |
|
__main__.py | File | 623 B | 0644 |
|
support.py | File | 552 B | 0644 |
|
testcallable.py | File | 4.33 KB | 0644 |
|
testhelpers.py | File | 28.02 KB | 0644 |
|
testmagicmethods.py | File | 16 KB | 0644 |
|
testmock.py | File | 49.29 KB | 0644 |
|
testpatch.py | File | 55.03 KB | 0644 |
|
testsentinel.py | File | 976 B | 0644 |
|
testwith.py | File | 10.34 KB | 0644 |
|