From 5d665aac39e4adebedccf67c6684ca4c5e373d1c Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 2 May 2020 22:57:03 +0100 Subject: [PATCH] Fix up test runner scripts --- bin/dev_run_test | 5 +---- bin/run_test.py | 27 --------------------------- bin/run_tests.py | 17 +---------------- 3 files changed, 2 insertions(+), 47 deletions(-) delete mode 100755 bin/run_test.py diff --git a/bin/dev_run_test b/bin/dev_run_test index 86500be2..6515c6b3 100755 --- a/bin/dev_run_test +++ b/bin/dev_run_test @@ -1,6 +1,3 @@ #!/bin/bash -cd "$(dirname "$0")" -cd .. - -CIBW_PLATFORM=linux ./bin/run_test.py $1 +CIBW_PLATFORM=linux pytest $1 diff --git a/bin/run_test.py b/bin/run_test.py deleted file mode 100755 index bee65de4..00000000 --- a/bin/run_test.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import subprocess -import sys - - -def single_run(test_project): - # run the test - subprocess.check_call( - [sys.executable, '-m', 'pytest', '-vv', os.path.join(test_project, 'cibuildwheel_test.py')], - ) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument("test_project_dir") - args = parser.parse_args() - - project_path = os.path.abspath(args.test_project_dir) - - if not os.path.exists(project_path): - print('No test project not found.', file=sys.stderr) - exit(2) - - single_run(project_path) diff --git a/bin/run_tests.py b/bin/run_tests.py index 4963a883..1880d4f1 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -3,28 +3,13 @@ import os import subprocess import sys -from glob import glob if __name__ == '__main__': # move cwd to the project root os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # run the unit tests - subprocess.check_call([sys.executable, '-m', 'pytest', 'unit_test']) # run the integration tests - - test_projects = sorted(glob('test/??_*')) - - if len(test_projects) == 0: - print('No test projects found. Aborting.', file=sys.stderr) - exit(2) - - print('Testing projects:', test_projects) - - run_test_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'run_test.py') - for project_path in test_projects: - subprocess.check_call([sys.executable, run_test_path, project_path]) - - print('%d projects built successfully.' % len(test_projects)) + subprocess.check_call([sys.executable, '-m', 'pytest', 'test'])