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

Change tests so different backends are not tested in the same test #13

Open
zerothi opened this issue Aug 18, 2023 · 4 comments
Open

Change tests so different backends are not tested in the same test #13

zerothi opened this issue Aug 18, 2023 · 4 comments

Comments

@zerothi
Copy link
Collaborator

zerothi commented Aug 18, 2023

One should use pytest.mark.parametrize instead, here we can even allow importorskip.
This would be more stable and easier to test going forward.

@Chrillebon
Copy link
Collaborator

Agreed. However, not all tests will work like this, as the kwargs will be sent to the specific backend.

@zerothi
Copy link
Collaborator Author

zerothi commented Aug 18, 2023

I don't know what you mean?

This would work just fine:

@pytest.mark.parametrize("backend", [
MP, pytest.param(PB, pytest.mark.skipif(... plotly importable)])
def test_quiver(backend):
    dtuplot.quiver(..., backend=backend)

with some changes to make it fully functional.

@zerothi
Copy link
Collaborator Author

zerothi commented Aug 18, 2023

There are many ways to expand on this.
But the idea would be to explicitly create tests for each backend. Having everything in 1 is not ideal.

@Chrillebon
Copy link
Collaborator

Agreed! And the addition of the skipif not importable is a great way of getting around the challenges with not every backend being installed as default!

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

No branches or pull requests

2 participants