ยปCore Development>Code coverage>Lib/unittest/test/__init__.py

Python code coverage for Lib/unittest/test/__init__.py

#countcontent
1n/aimport os
2n/aimport sys
3n/aimport unittest
4n/a
5n/a
6n/ahere = os.path.dirname(__file__)
7n/aloader = unittest.defaultTestLoader
8n/a
9n/adef suite():
10n/a suite = unittest.TestSuite()
11n/a for fn in os.listdir(here):
12n/a if fn.startswith("test") and fn.endswith(".py"):
13n/a modname = "unittest.test." + fn[:-3]
14n/a __import__(modname)
15n/a module = sys.modules[modname]
16n/a suite.addTest(loader.loadTestsFromModule(module))
17n/a suite.addTest(loader.loadTestsFromName('unittest.test.testmock'))
18n/a return suite
19n/a
20n/a
21n/aif __name__ == "__main__":
22n/a unittest.main(defaultTest="suite")