Skip to content

Glossary: Refactoring and Clean Code

fixture (pytest)

Also written: fixtures, pytest fixture

A helper that pytest hands to a test function by name, such as `capsys` or `monkeypatch`. It gives the test something it needs, like captured output.

Where the book teaches it

Related terms

capsysmonkeypatch