In pytest, there are two primary configuration files that can be used to drive the behavior of our testing environment:
- pytest.ini takes care of configuring pytest itself, so the options we set there are mostly related to tweaking the behavior of the test runner and discovery. These options are usually available as command-line options too.
- conftest.py is aimed at configuring our tests and test suite, so it's the place where we can declare new fixtures, attach plugins, and change the way our tests should behave.
While pytest has grown over the years, with other ways being developed to configure the behavior of pytest itself or of the test suite, the two aforementioned ways are probably the most widespread.
For example, for a fizzbuzz project, if we have a test suite with the classical basic distinction between the source code, unit tests, and functional tests, then we could have a pytest.ini file within the project directory to drive how pytest should...