diff options
author | Chun Kuan Lee <ken2812221@gmail.com> | 2018-09-25 10:51:46 +0800 |
---|---|---|
committer | Chun Kuan Lee <ken2812221@gmail.com> | 2018-09-26 04:25:31 +0800 |
commit | c7b3e487f229142795a0b3ce6ce409ce7084d966 (patch) | |
tree | 570047d437145af5c7ea1101619a951587c84282 /test/functional/test_runner.py | |
parent | 8efd87455bc957d6647c41680541d84e98e8353f (diff) |
tests: exclude all tests with difference parameters
Diffstat (limited to 'test/functional/test_runner.py')
-rwxr-xr-x | test/functional/test_runner.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 28437f8925..d9960460d9 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -285,11 +285,13 @@ def main(): # Remove the test cases that the user has explicitly asked to exclude. if args.exclude: - exclude_tests = [re.sub("\.py$", "", test) + (".py" if ".py" not in test else "") for test in args.exclude.split(',')] + exclude_tests = [test.split('.py')[0] for test in args.exclude.split(',')] for exclude_test in exclude_tests: - if exclude_test in test_list: - test_list.remove(exclude_test) - else: + # Remove <test_name>.py and <test_name>.py --arg from the test list + exclude_list = [test for test in test_list if test.split('.py')[0] == exclude_test] + for exclude_item in exclude_list: + test_list.remove(exclude_item) + if not exclude_list: print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], exclude_test)) if not test_list: |