Index Ai Academy
Glossary · Phase 7 · Software engineering

Fixture

Also written: fixtures

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.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write