Skip to content

Commit 256181e

Browse files
authored
Merge pull request #24 from matplotlib/support-parametrized
Properly support parametrized tests
2 parents 13b0176 + b6cc961 commit 256181e

11 files changed

+13
-1
lines changed

pytest_mpl/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ def item_function_wrapper(*args, **kwargs):
147147
# Find test name to use as plot name
148148
filename = compare.kwargs.get('filename', None)
149149
if filename is None:
150-
filename = original.__name__ + '.png'
150+
filename = item.name + '.png'
151+
filename = filename.replace('[', '_').replace(']', '_')
152+
filename = filename.replace('_.png', '.png')
151153

152154
# What we do now depends on whether we are generating the
153155
# reference images or simply running the test.
4.39 KB
Loading
5.14 KB
Loading
7.81 KB
Loading
4.39 KB
Loading
5.28 KB
Loading
7.8 KB
Loading
4.39 KB
Loading
5.28 KB
Loading
7.8 KB
Loading

0 commit comments

Comments
 (0)