| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
If you stacked `pytest.mark.parametrize` with check_figures_equal every set of parameters would write to the same file. This makes post-hoc debugging hard and causes intermittent CI failures.
They are preceded by a `*args` in the signature of wrapper.
There was a problem hiding this comment.
postci
Sorry, something went wrong.
|
This seems to fail a lot; can we get it in 3.2.1 too? |
Sorry, something went wrong.
|
Is there an existing "make this a safe name" function someplace in the standard library or do we have to roll our own here? |
Sorry, something went wrong.
This is probably to stringent but this is better than blindly using the test name from pytest.
I'm not aware of anything like that. If anything I'd expect that in pathlib, but it is OS-depended, so would need to be handled in PurePosixPath \ PureWindowsPath. |
Sorry, something went wrong.
|
The failure was _________________________ test_loglog_nonpos[png-True] _________________________ [gw0] linux -- Python 3.8.2 /opt/hostedtoolcache/Python/3.8.2/x64/bin/python expected = '/home/vsts/work/1/s/result_images/test_axes/test_loglog_nonpos-expected.png' actual = '/home/vsts/work/1/s/result_images/test_axes/test_loglog_nonpos.png' tol = 0, in_decorator = True This makes me think that we should be doing something similar in compare_images... |
Sorry, something went wrong.
|
abc9445 adds the comment from @QuLogic # This is hacked on via the mpl_image_comparison_parameters fixture
# so that we don't need to modify the function's real signature for
# any parametrization. Modifying the signature is very very tricky
# and likely to confuse pytest.
which is definitely true! I think the tools we can use to do this are better now (3 years later). Might be worth re-visiting that decorator to see if we can make in simpler (and stop using the in-direct fixtur paramterization that pytest tried to deprecate). |
Sorry, something went wrong.
|
With #15199 backported, I think we should be able to backport this as well without conflicts. |
Sorry, something went wrong.
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
$ git checkout v3.2.x $ git pull
$ git cherry-pick -m1 b4a414fd5abf1b3b930bf3319ed9d1802db47be6
$ git commit -am 'Backport PR #16693: TST: use pytest name in naming files for check_figures_equal'
git push YOURFORK v3.2.x:auto-backport-of-pr-16693-on-v3.2.x
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Sorry, something went wrong.
…_names TST: use pytest name in naming files for check_figures_equal
…_names TST: use pytest name in naming files for check_figures_equal
|
So we needed #15589 to avoid conflicts; it seems pretty non-controversial, so I included it in the backport above. |
Sorry, something went wrong.
|
This seems to have crossed with #16707, which has a test that takes request: ______ ERROR collecting lib/matplotlib/tests/test_marker.py _____
lib/matplotlib/tests/test_marker.py:105: in <module>
@check_figures_equal(tol=1.45)
lib/matplotlib/testing/decorators.py:419: in decorator
inspect.Parameter("request", KEYWORD_ONLY),
/var/container/conda/envs/mpl37/lib/python3.7/inspect.py:2856: in replace
return_annotation=return_annotation)
/var/container/conda/envs/mpl37/lib/python3.7/inspect.py:2795: in __init__
raise ValueError(msg)
E ValueError: duplicate parameter name: 'request'
so I guess there's a reason I wrote that indirection comment... |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
If you stacked pytest.mark.parametrize with check_figures_equal
every pass through would write to the same files. This uses the request fixture to extract the name.
PR Checklist