Fix stairs() tests#18579
Conversation
|
Done: The slight differences come from the fact that Still to do: The axis limit is not updated by |
|
Whoops, I didn't realize you were fixing it up yourself. I can remove the test changes from the other PR entirely if you prefer. The set_baseline should not update the limit manually because from what I see set_data doesn't do that in general. The limit need to be updated manually in the test. |
We have to use fixed view limits because stairs() does autoscale, but updating data does not. Otherwise the test and ref way of generating the plot would end up with different view limits.
@andrzejnovak Thanks, I'd prefer that. Let's get the existing functionality tested correctly before adding more functionality in #18511. |
PR Summary
CC @andrzejnovak
Fixes:
check_figures_equaltests did not test anything because fixture figures were not used. Instead the tests created new figures, which were not compared.check_figures_equaltests to png. - No need to additionally test vector backends, because this is about the logic creating the artist, not how it's drawn by a backend.pytest.raises.pytest.xfailis only for excluding broken tests.StepPatchby default (_edge_default = False). This was proposed anyway in feat: StepPatch #18275 (review) / feat: StepPatch #18275 (comment). IMHO it's the right thing to do as most of our patches behave that way; in particular bar charts which are closely related to theStepPatch.Still there are two issues:
test_stairsThe actual/expected differ in the corners of the steps. - To be investigated.
difference:
expected:
test_stailrs_updateThe axis limit is not updated by
h.set_baseline(-2). Should it be?actual:
expected: