TestRelic

Get Started with pytest

Install testrelic-pytest, set your API key, and run your first reported pytest suite — no conftest wiring required.

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

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.

Enriching results from Allure reports? Install the optional extra so the Allure reader is available:

Terminal
pip install "testrelic-pytest[allure]"

JUnit XML enrichment needs no extra. See Report Enrichment.

Requirements

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

Next steps

Was this page helpful?

On this page