def getSuites(): suites = [doctestSuite] loader = TestLoader() for startDir in searchDirs: for testFile in findTests(startDir, skipFiles): modBase = os.path.splitext(testFile)[0] name = modBase.replace(os.path.sep, '.') # import the testFile as a module mod = importModule(name) # iterate through module objects, checking for TestCases for objName in dir(mod): if not objName.endswith('TestCase'): continue obj = getattr(mod, objName) if not issubclass(obj, TestCase): continue # create a suite from any test cases suite = loader.loadTestsFromTestCase(obj) # append to suites list suites.append(suite) return suites
from test.test_all import searchDirs, skipFiles base = ['test', 'sources', 'rtfng'] pending = base + ['pending'] baseDir = os.path.join(*base) pendingDir = os.path.join(*pending) doneList = [] requestedList = sys.argv[1:] if requestedList: print('Only writing these methods: %s' % ', '.join(requestedList)) # iterate through the test files for startDir in searchDirs: for testFile in findTests(startDir, skipFiles): modBase = os.path.splitext(testFile)[0] name = modBase.replace(os.path.sep, '.') # import the testFile as a module mod = importModule(name) # iterate through module objects, checking for TestCases for objName in dir(mod): if not objName.endswith('TestCase'): continue obj = getattr(mod, objName) if not issubclass(obj, TestCase): continue # iterate through the TestCase attrs, looking for make_* # methods for attrName in dir(obj): if attrName.startswith('make_'):
from test.test_all import searchDirs, skipFiles base = ['test', 'sources', 'rtfng'] pending = base + ['pending'] baseDir = os.path.join(*base) pendingDir = os.path.join(*pending) doneList = [] requestedList = sys.argv[1:] if requestedList: print 'Only writing these methods: %s' % ', '.join(requestedList) # iterate through the test files for startDir in searchDirs: for testFile in findTests(startDir, skipFiles): modBase = os.path.splitext(testFile)[0] name = modBase.replace(os.path.sep, '.') # import the testFile as a module mod = importModule(name) # iterate through module objects, checking for TestCases for objName in dir(mod): if not objName.endswith('TestCase'): continue obj = getattr(mod, objName) if not issubclass(obj, TestCase): continue # iterate through the TestCase attrs, looking for make_* # methods for attrName in dir(obj): if attrName.startswith('make_'):