Skip to content

Commit 3f3b5ba

Browse files
authored
Use test_name in place of item name for saved array
Previously tests could not be inherited from classes in a way that let each class save its own array. This change makes the file written use the full test name, including the class name, instead of just the test name within the class.
1 parent 069039b commit 3f3b5ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytest_arraydiff/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ def pytest_runtest_call(self, item):
313313
if single_reference:
314314
filename = item.originalname + '.' + extension
315315
else:
316-
filename = item.name + '.' + extension
316+
filename = test_name
317+
filename = filename.replace('.', '_')
318+
filename = filename + '.' + extension
317319
filename = filename.replace('[', '_').replace(']', '_')
318320
filename = filename.replace('_.' + extension, '.' + extension)
319321

0 commit comments

Comments
 (0)