diff options
author | Sergio Martins <smartins@kde.org> | 2019-05-05 15:58:54 +0100 |
---|---|---|
committer | Sergio Martins <sergio.martins@kdab.com> | 2019-05-05 18:19:23 +0100 |
commit | f958d903b653d75bcaabd819a15494b42868fa6f (patch) | |
tree | a5a09f2793f15f356c080ac28e1741af7c60ed3a | |
parent | ede2633b83b008677f838a49eec3ca24843ad87f (diff) |
tests: fix yaml files not being removed
-rwxr-xr-x | tests/run_tests.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py index 387269c6..9a0481ee 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -108,7 +108,7 @@ class Test: return name def removeYamlFiles(self): - for f in [test.yamlFilename(False), test.yamlFilename(True)]: + for f in [self.yamlFilename(False), self.yamlFilename(True)]: if os.path.exists(f): os.remove(f) @@ -592,7 +592,6 @@ def run_unit_test(test, is_standalone): # Check that it printed the expected warnings if not compare_files(test.expects_failure, expected_file, result_file, test.printableName(is_standalone, False)): - test.removeYamlFiles(); return False if test.has_fixits: @@ -604,11 +603,17 @@ def run_unit_test(test, is_standalone): def run_unit_tests(tests): result = True for test in tests: + test_result = True if not _only_standalone: - result = result and run_unit_test(test, False) + test_result = run_unit_test(test, False) + result = result and test_result if not _no_standalone: - result = result and run_unit_test(test, True) + test_result = test_result and run_unit_test(test, True) + result = result and test_result + + if not test_result: + test.removeYamlFiles(); global _was_successful, _lock with _lock: |