-
-
Notifications
You must be signed in to change notification settings - Fork 20
Fix single_reference=True #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nope does not appear to work. |
pytest_arraydiff/plugin.py
Outdated
filename = item.name + '.' + extension | ||
filename = item.function + '.' + extension | ||
if not single_reference: | ||
filename = filename.replace('[', '_').replace(']', '_') | ||
filename = filename.replace('_.' + extension, '.' + extension) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work:
if filename is None:
if single_reference:
filename = item.function + '.' + extension
else:
filename = item.name + '.' + extension
filename = filename.replace('[', '_').replace(']', '_')
filename = filename.replace('_.' + extension, '.' + extension)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! I updated the patch and added you as co-author of the commit.
Co-authored-by: Conor MacBride <[email protected]>
8d4086a
to
bb77553
Compare
Yay, CI is green now. Thanks! I have no expertise nor interest to add a unit test but @astrofrog is welcome to push to my branch if he wants a test. 😉 |
I've added a regression test, which unfortunately shows that the fix here doesn't work |
@ConorMacBride - for some reason the function name is ending up being |
2eba80d
to
86e919e
Compare
Ok I got it to work, it was |
Thanks, @astrofrog ! |
Fix #42