Skip to content

Commit 19dac01

Browse files
committed
Include class name in generated test name
1 parent 50251e5 commit 19dac01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytest_mpl/plugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ def generate_test_name(self, item):
302302
"""
303303
Generate a unique name for the hash for this test.
304304
"""
305-
return f"{item.module.__name__}.{item.name}"
305+
if item.cls is not None:
306+
name = f"{item.module.__name__}.{item.cls.__name__}.{item.name}"
307+
else:
308+
name = f"{item.module.__name__}.{item.name}"
309+
return name
306310

307311
def make_test_results_dir(self, item):
308312
"""

0 commit comments

Comments
 (0)