AI engineering glossary · Python advanced

What is conftest.py?

conftest.py: A special pytest file whose fixtures and hooks are automatically available to all tests in its directory and below, without importing. It is used to share common setup across test files.

Level: advancedTopic: Python advanced

conftest.py: an example

Placing a database fixture in tests/conftest.py makes it usable in every test module under tests.

Related terms

More Python advanced terms

Where you learn it

conftest.py 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.