In 2013/2014 I wrote a 4 part series on pytest fixtures.
It started out fine-ish. And then by part 4 I crammed way too many concepts into one huge post.
Well, I’ve recently reviewed all of this, and
- split the posts into one concept each
- made sure all of the info was correct for modern versions of Python and pytest
- reran the examples to make sure the output is correct
Here’s the new/old series:
- pytest fixtures nuts and bolts
- pytest xunit-style fixtures
- Basic pytest fixtures example
- Using pytest fixtures by naming them
- Using pytest autouse fixtures
- Using pytest fixtures with mark.usefixtures
- pytest fixture return value
- pytest fixture teardown
- pytest fixture scope
- Parametrizing pytest fixtures with param
- Using multiple pytest fixtures
- Modularity: pytest fixtures using other fixtures
- pytest session scoped fixtures
- Mixing pytest fixture scope
If you see something odd, please let me know.