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
Parametrised tests like in pytest #15497
Comments
I've always just used a loop to parameterize a test. |
With a If you look at what With |
My biggest concern with this sort of thing has always been over complicating the tests. Tests should be as simple as possible, so that you can be sure that they are correct. Parameterization is relatively simple, but things can get complicated fast. I also never really liked pytest's parameterization syntax. I think it would be simpler to write |
I also dislike the syntax but that would be easy to solve: just make a helper on top of pytest's I've been spending a bit of time running tests from I think that |
It doesn't look as if sympy's test module has a way to do parametrised tests like pytest does. These could be very useful in e.g. the
test_ode.py
which has many repetitive but not always consistent tests.With
pytest
it works like this:Then each case becomes a separate test:
You can the easily re-run only the failed test with
This looks like something that would be very useful in sympy but doesn't seem to be implemented. On the hand it seems like maybe the best way to get this would just be to use pytest.
The text was updated successfully, but these errors were encountered: