Skip to content

Conversation

@ghickman
Copy link
Contributor

Our use of subtests didn't remove much setup for the tests, but made it harder to target specific iterations of the tests.

Since the structure we were looping to perform the subtests fits perfectly with pytest's parametrize I've switched us to that. The main benefit here is that you can target each test now, using the test ids defined in the parametrize mark, for example, this is now a valid pytest invocation:

pytest tests/test_page_snapshots.py::test_page_html[klass-detail.html]

This format of test name will also be printed when tests fail, so a developer can see which templates failed in the output.

@ghickman ghickman requested a review from meshy April 22, 2025 13:52
@ghickman ghickman merged commit 07c43dc into main Apr 24, 2025
1 check passed
@ghickman ghickman deleted the remove-subtests branch April 24, 2025 13:22
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

Successfully merging this pull request may close these issues.

3 participants