def get_tests(): HERE = os.path.dirname(os.path.abspath(__file__)) input_dir = os.path.join(HERE, 'input') suite = [] for fname in os.listdir(input_dir): if fname != '__init__.py' and fname.endswith('.py'): suite.append(test_functional.FunctionalTestFile(input_dir, fname)) return suite
def get_tests(input_dir='input', sort=False): def _file_name(test): return test.base HERE = os.path.dirname(os.path.abspath(__file__)) input_dir = os.path.join(HERE, input_dir) suite = [] for fname in os.listdir(input_dir): if fname != '__init__.py' and fname.endswith('.py'): suite.append(test_functional.FunctionalTestFile(input_dir, fname)) # when testing the db_performance plugin we need to sort by input file name # because the plugin reports the errors in close() which appends them to the # report for the last file in the list if sort: suite.sort(key=_file_name) return suite
def _test_module(path): test = LintModuleTest(test_functional.FunctionalTestFile(str(path.parent), path.name)) test.setUp() test._runTest()