Skip to content

Commit ba67f3c

Browse files
committed
Change test_array to filepath
1 parent 30974dc commit ba67f3c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pytest_arraydiff/plugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ def item_function_wrapper(*args, **kwargs):
310310

311311
# Save the figure
312312
result_dir = tempfile.mkdtemp()
313-
test_array = os.path.abspath(os.path.join(result_dir, filename))
313+
filepath = os.path.abspath(os.path.join(result_dir, filename))
314314

315-
FORMATS[file_format].write(test_array, array, **write_kwargs)
315+
FORMATS[file_format].write(filepath, array, **write_kwargs)
316316

317317
# Find path to baseline array
318318
if baseline_remote:
@@ -325,22 +325,22 @@ def item_function_wrapper(*args, **kwargs):
325325
Generated file:
326326
\t{test}
327327
This is expected for new tests.""".format(
328-
test=test_array))
328+
test=filepath))
329329

330330
# distutils may put the baseline arrays in non-accessible places,
331331
# copy to our tmpdir to be sure to keep them in case of failure
332332
baseline_file = os.path.abspath(os.path.join(result_dir, 'reference-' + filename))
333333
shutil.copyfile(baseline_file_ref, baseline_file)
334334

335-
identical, msg = FORMATS[file_format].compare(baseline_file, test_array, atol=atol, rtol=rtol)
335+
identical, msg = FORMATS[file_format].compare(baseline_file, filepath, atol=atol, rtol=rtol)
336336

337337
if identical:
338338
shutil.rmtree(result_dir)
339339
else:
340340
raise Exception(msg)
341341

342342
else:
343-
343+
1/0
344344
if not os.path.exists(self.generate_dir):
345345
os.makedirs(self.generate_dir)
346346

0 commit comments

Comments
 (0)