Much of py.test's functionality is implemented as a plugin.
You can find the source code of all default plugins in http://bitbucket.org/hpk42/py-trunk/src/tip/py/test/plugin/
pytest_terminal: default reporter for writing info to terminals
pytest_resultlog: log test results in machine-readable form to a file
pytest_unittest: run traditional unittest TestCase instances
pytest_doctest: run doctests in python modules or .txt files
pytest_restdoc: provide RestructuredText syntax and link checking
pytest_xfail: provides "expected to fail" test marker
pytest_tmpdir: provide temporary directories to test functions
pytest_plugintester: generic plugin apichecks, support for functional plugin tests
py.test loads and configures plugins at tool startup:
Specifying a plugin in a test module or conftest.py will only lead to activitation when py.test actually sees the directory and the file during the collection process. This is already after command line parsing and there is no try to do a "pre-scan of all subdirs" as this would mean a potentially very large delay. As long as you don't add command line options this detail does not need to worry you.
If you create a conftest.py file with the following content:
pytest_plugins = "pytest_myextension",
then all tests in and below that directory will consult the hooks defined in the imported pytest_myextension. A plugin may specify its dependencies via another pytest_plugins definition.