Skip to content

Commit df4c96b

Browse files
committed
Don't make an extra copy of the expected image outside of the result_images directory.
1 parent d021ef0 commit df4c96b

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

lib/matplotlib/testing/compare.py

-7
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,15 @@ def compare_images( expected, actual, tol, in_decorator=False ):
232232

233233
diff_image = os.path.join(os.path.dirname(actual),
234234
'failed-diff-'+os.path.basename(actual))
235-
expected_copy = 'expected-'+os.path.basename(actual)
236235

237236
if ( (rms / 10000.0) <= tol ):
238237
if os.path.exists(diff_image):
239238
os.unlink(diff_image)
240-
if os.path.exists(expected_copy):
241-
os.unlink(expected_copy)
242239
return None
243240

244241
save_diff_image( expected, actual, diff_image )
245242

246243
if in_decorator:
247-
shutil.copyfile( expected, expected_copy )
248244
results = dict(
249245
rms = rms,
250246
expected = str(expected),
@@ -253,9 +249,6 @@ def compare_images( expected, actual, tol, in_decorator=False ):
253249
)
254250
return results
255251
else:
256-
# expected_copy is only for in_decorator case
257-
if os.path.exists(expected_copy):
258-
os.unlink(expected_copy)
259252
# old-style call from mplTest directory
260253
msg = " Error: Image files did not match.\n" \
261254
" RMS Value: " + str( rms / 10000.0 ) + "\n" \

0 commit comments

Comments
 (0)