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

[MAINT] change tests to figure testing #145

Open
slumnitz opened this issue Sep 27, 2021 · 1 comment
Open

[MAINT] change tests to figure testing #145

slumnitz opened this issue Sep 27, 2021 · 1 comment

Comments

@slumnitz
Copy link
Member

Most of splot's tests are based on testing whether or not a figure is generated.
This should slowly transition to testing the content of the figure itself as suggested by @martinfleis in #140

One option is to get the attributes from the plotted collection as we do in geopandas https://github.com/geopandas/geopandas/blob/64598b6f0d872baf09657c27a9aa4c87d86d9131/geopandas/tests/test_plotting.py#L169

The other is to keep a reference image in tests and check against that as matplotlib does in some cases https://github.com/matplotlib/matplotlib/blob/ec126b0175c657f0adb5ca635eeabad7c142bb0b/lib/matplotlib/tests/test_colorbar.py#L188-L190

@jGaboardi
Copy link
Member

xref pysal/libpysal#533 (comment)

re: plotting tests

I've had success with matplotlib's decorator – image_comparison

We should probably open a specific issue for this.

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

No branches or pull requests

2 participants