35 lines · 1022 B · Python
RawDownload
"""Test suite for distutils. This test suite consists of a collection of test modules in thedistutils.tests package.  Each test module has a name starting with'test' and contains a function test_suite().  The function is expectedto return an initialized unittest.TestSuite instance. Tests for the command classes in the distutils.command package areincluded in distutils.tests as well, instead of using a separatedistutils.command.tests package, since command identification is doneby import rather than matching pre-defined names. """ import osimport sysimport unittest  here = os.path.dirname(__file__)  def test_suite():    suite = unittest.TestSuite()    for fn in os.listdir(here):        if fn.startswith("test") and fn.endswith(".py"):            modname = "distutils.tests." + fn[:-3]            __import__(modname)            module = sys.modules[modname]            suite.addTest(module.test_suite())    return suite  if __name__ == "__main__":    unittest.main(defaultTest="test_suite")