Replace a huge SpectralQuantity test with smaller ones#19049
Conversation
A single test with several `pytest.raises()` checks has been replaced with several parametrized tests which all have only a single `pytest.raises()` check. Previously one failing check prevented all the following checks from being executed at all, but now they can be tested independently from each other.
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 5 months. I plan to close this in a month if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
Description
I am replacing a test with many
pytest.raises()checks with several parametrized tests which all have only a singlepytest.raises()check. The advantage of doing this is that the smaller tests can be executed independently from each other, but in currentmaina failingpytest.raises()check will prevent the following checks from running at all.Furthermore, I found a bug in
SpectralQuantityinvolvingUnitBase.is_equivalent()if unit equivalencies have been enabled, and the changes here make it much easier to write the regression test.