Skip to main content
Ask AI

Get Started with pytest

Getting started takes three steps: install the package, set your API key, and run pytest. The plugin auto-registers through a pytest11 entry point, so there is no conftest.py wiring to add.

Paste this prompt into your coding agent:

Setup prompt
Add TestRelic reporting to this pytest project.
1. Install the package: pip install testrelic-pytest
2. Set the environment variable TESTRELIC_API_KEY to my TestRelic API key
(format tr_live_...). Do not hardcode it into source — use the shell
environment or the project's existing secrets mechanism.
3. Do NOT add any conftest.py wiring or imports — the plugin auto-registers
via its pytest11 entry point.
4. Run `pytest` and confirm results upload to the TestRelic cloud.

Full quickstart

Terminal
pip install testrelic-pytest
export TESTRELIC_API_KEY=tr_live_...
pytest
note

There is nothing to import and no conftest.py to edit. As long as testrelic-pytest is installed in the same environment as pytest, the plugin is active automatically.

Requirements

  • Python >=3.9
  • pytest>=7.0
  • httpx>=0.27

Next steps