diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -904,17 +904,16 @@ def runone(options, test): hgrc.write('[%s]\n%s\n' % (section, key)) hgrc.close() - ref = os.path.join(TESTDIR, test+".out") err = os.path.join(TESTDIR, test+".err") if os.path.exists(err): os.remove(err) # Remove any previous output files lctest = test.lower() - if lctest.endswith('.py'): - runner = pytest - elif lctest.endswith('.t'): - runner = tsttest - ref = testpath + for ext, func, out in testtypes: + if lctest.endswith(ext): + runner = func + ref = os.path.join(TESTDIR, test + out) + break else: return skip("unknown test type") @@ -1234,6 +1233,9 @@ def runtests(options, tests): if failed: sys.exit(1) +testtypes = [('.py', pytest, '.out'), + ('.t', tsttest, '')] + def main(): (options, args) = parseargs() if not options.child: