conftest.py is a special pytest file used to define shared fixtures, hooks, and configuration for tests. Pytest discovers and imports it while collecting or running tests, so code in the file may execute even though it is not an application entry point.
This makes conftest.py a security-sensitive part of a repository. Malicious or unexpected code there could run on a developer’s machine or in a CI job when tests are invoked, potentially accessing credentials or other resources available to that environment. Before testing an unfamiliar project, review its conftest.py files and related imports, and use isolated environments with limited secrets and permissions.


