Glossary · Phase 7 · Software engineering
Fixture
In pytest, a function that builds the setup a test needs; a test asks for it by naming it as a parameter.
Try it now
Use the lightest tool that works. Most tests need no fakes at all; fakes are for the parts you can't control.
Learn it properly
Testing with pytest · Fixtures, parametrize, mocks, temporary files and coverage. About 45 minutes.
Other terms from the same lesson
- mock object: A stand-in object for tests that records how it was called, so a test can replace an email sender or an API.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.