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 all for-loops in unit tests to parametrised tests #110

Closed
lukashergt opened this issue Jul 1, 2020 · 2 comments · Fixed by #319
Closed

change all for-loops in unit tests to parametrised tests #110

lukashergt opened this issue Jul 1, 2020 · 2 comments · Fixed by #319
Labels
tests Collection of fixes/features for test suite upgrades
Milestone

Comments

@lukashergt
Copy link
Collaborator

Instead of using for-loops in unit tests it would be better to use parametrised tests using @pytest.mark.parametrize. These decorators can also be stacked on top of each other in which case all combinations are performed (the equivalent of nested for-loops).

Using parametrised tests has the huge advantage that a failed test will tell which parametrisation exactly caused the issue, which would be lost in a for-loop.

Some of the unit tests have already been converted to parametrised tests. It would be good to extend that to all other tests that involve for-loops.

@williamjameshandley
Copy link
Collaborator

Partially implemented by @lukashergt in #109 and #99.

@williamjameshandley williamjameshandley added this to the 2.0.1 milestone Aug 8, 2022
@williamjameshandley williamjameshandley added the tests Collection of fixes/features for test suite upgrades label Apr 5, 2023
@williamjameshandley
Copy link
Collaborator

We should also move to more skips of e.g. fgivenx and astropy rather than checks #314

This was referenced Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Collection of fixes/features for test suite upgrades
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants