From d9b74e057147af887cb7867d59db45ad5f455ef0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Sun, 24 Jun 2018 12:05:21 -0400 Subject: [PATCH] Don't run core Python tests on CircleCI --- benchmark/benchmark.py | 16 +++++++++------- test/test_python.py | 29 +++++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 12aaa88f7..15f7ef341 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -25,14 +25,16 @@ def run_native(hostpython, code): def run_wasm(code): s = conftest.SeleniumWrapper() - s.load_package('numpy') - s.run(code) try: - runtime = float(s.logs[-1]) - except ValueError: - print('\n'.join(s.logs)) - raise - s.driver.quit() + s.load_package('numpy') + s.run(code) + try: + runtime = float(s.logs[-1]) + except ValueError: + print('\n'.join(s.logs)) + raise + finally: + s.driver.quit() return runtime diff --git a/test/test_python.py b/test/test_python.py index f5286c76a..941a8ceb2 100644 --- a/test/test_python.py +++ b/test/test_python.py @@ -171,18 +171,19 @@ def test_run_core_python_test(python_test, selenium): def pytest_generate_tests(metafunc): if 'python_test' in metafunc.fixturenames: test_modules = [] - with open( - str(pathlib.Path(__file__).parents[0] / - "python_tests.txt")) as fp: - for line in fp: - line = line.strip() - if line.startswith('#'): - continue - parts = line.split() - if len(parts) == 1: - test_modules.append(parts[0]) - # XXX: The tests take too long to run, so we're just doing - # a sanity check on the first 25 - if 'TRAVIS' in os.environ and len(test_modules) > 25: - break + if 'CIRCLECI' not in os.environ: + with open( + str(pathlib.Path(__file__).parents[0] / + "python_tests.txt")) as fp: + for line in fp: + line = line.strip() + if line.startswith('#'): + continue + parts = line.split() + if len(parts) == 1: + test_modules.append(parts[0]) + # XXX: The tests take too long to run, so we're just doing + # a sanity check on the first 25 + if 'TRAVIS' in os.environ and len(test_modules) > 25: + break metafunc.parametrize("python_test", test_modules)