Skip to content

Glossary: Python Beyond the Basics

fixture

Also written: fixtures, tmp_path, @pytest.fixture

A helper that pytest passes to a test when the test names it as a parameter. `tmp_path` gives each test a fresh temporary folder, and you can write your own with `@pytest.fixture`.

Where the book teaches it

Related terms

pytestmonkeypatch