Fix Cycles ctests not always deleting fail.png files on success.

This commit is contained in:
Brecht Van Lommel 2016-07-29 02:04:45 +02:00
parent e30f9b04fc
commit 52fb441c13
1 changed files with 7 additions and 6 deletions

View File

@ -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):