Skip to content
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

Support hierarchical tests #85

Open
theRealSuperMario opened this issue Sep 28, 2019 · 2 comments
Open

Support hierarchical tests #85

theRealSuperMario opened this issue Sep 28, 2019 · 2 comments

Comments

@theRealSuperMario
Copy link

theRealSuperMario commented Sep 28, 2019

Hi,

I am working a lot with images and therefore love the idea of the project. I played around with it a little bit and noticed something.

When I group my tests in classes, the image file gets named only after the function that calls it.

Example:

class Test_Imageutils:
    @pytest.mark.mpl_image_compare
    def test_put_text(self):
        from skimage import data
        astronaut = data.astronaut()
        annotated = imageutils.put_text(astronaut.copy(), "hi", loc="center")
        fig, ax = plt.subplots(1, 1, figsize=(6, 6))
        ax.imshow(annotated)
        return fig

And the image in baseline is named test_put_text.png

I think it would be a great idea to add an option to write the full hierarchy, either into folders or into the file name. For example

  • baseline/Test_Imageutils/test_put_text.png
  • baseline/Test_Imageutils-test_put_text.png

What do you think?

I could dig a little into the code and come up with a PR if anyone thinks it is a good idea.

@theRealSuperMario
Copy link
Author

Over a year later, I finally decided to go on and do this.

I tried to see if this is maybe already fixed, but is does not seem to be the case.

Bildschirmfoto 2021-03-04 um 13 55 38

Bildschirmfoto 2021-03-04 um 13 55 33

@theRealSuperMario
Copy link
Author

It looks like since 9e7c62e, this is already possible by adjusting the pytest settings.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant