

If exists, load conftest.py and test*/conftest.py relative If no test paths are specified, use the current dir as a test path This happens before normal command-line parsing.īy loading all plugins registered through setuptools entry points.īy loading all plugins specified through the PYTEST_PLUGINS environment variable.īy loading all conftest.py files as inferred by the command line This happens before normal command-line parsing.īy scanning the command line for the -p name optionĪnd loading the specified plugin. Pytest loads plugin modules at tool startup in the following way:īy scanning the command line for the -p no:name optionĪnd blocking that plugin from being loaded (even builtin plugins canīe blocked this way). Naming convention, making them easy to distinguish and find. Number of registered implementation functions for a given specification.Īll specifications and implementations follow the pytest_ prefix In principle, each hook call is a 1:N Python function call where N is the Reporting by calling well specified hooks of the following plugins:īuiltin plugins: loaded from pytest’s internal _pytest directory.Įxternal plugins: modules discovered throughĬonftest.py plugins: modules auto-discovered in test directories Pytest implements all aspects of configuration, collection, running and

Writing hooksĮxplains the basics and details of how you can write a hook function yourself. Please refer to Installing and Using plugins if youĪ plugin contains one or multiple hook functions. Or pip-installable plugins that can be used throughout many projects, It is easy to implement local conftest plugins for your own project
