conftest.py

A special pytest file whose fixtures and hooks are available to every test in its directory and below without importing them.

In more detail

Put shared fixtures here instead of in each test file. A project can have several conftest.py files at different directory levels.

Related terms

Taught in

References