AI engineering glossary · Python advanced

What is fixture?

Fixture: A reusable piece of setup, and optional teardown, that pytest supplies to tests by name through function arguments. It provides things such as sample data, database connections or temporary files.

Level: intermediateTopic: Python advanced

Fixture: an example

@pytest.fixture def sample_df(): return pd.DataFrame(...) then def test_x(sample_df): receives that data.

Related terms

More Python advanced terms

Where you learn it

Fixture is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.