diff options
Diffstat (limited to 'tests/python/cycles_render_tests.py')
-rwxr-xr-x | tests/python/cycles_render_tests.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index e1b5e2d1d23..1434447416d 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -66,15 +66,16 @@ def verify_output(filepath): ) try: subprocess.check_output(command) - if os.path.exists(failed_image): - os.remove(failed_image) - return True + failed = False except subprocess.CalledProcessError as e: - if e.returncode != 1: - shutil.copy(TEMP_FILE, failed_image) if VERBOSE: print(e.output.decode("utf-8")) - return e.returncode == 1 + failed = e.returncode != 1 + if failed: + shutil.copy(TEMP_FILE, failed_image) + elif os.path.exists(failed_image): + os.remove(failed_image) + return not failed def run_test(filepath): |