Package Overview

How testrelic-deepeval captures DeepEval runs — the pytest plugin, the evaluate() wrapper, the offline queue, and the native evals upload path.

testrelic-deepeval (pip name testrelic-deepeval, version 0.1.4) captures DeepEval evaluation results and uploads them to TestRelic's native /api/v1/evals/* API. It reads DeepEval's in-memory TestRun only — no monkey-patching and no HTTP redirect.

Install

Terminal
pip install testrelic-deepeval

To install DeepEval alongside the SDK, use the optional extra (it pulls deepeval>=2.0,<4.0):

Terminal
pip install "testrelic-deepeval[deepeval]"
DetailValue
pip nametestrelic-deepeval
Version0.1.4
Python>=3.10 (tested 3.10–3.12)
Core depshttpx>=0.27, pydantic>=2.6, typer>=0.12, platformdirs>=4.0, tomli-w>=1.0
DeepEval extratestrelic-deepeval[deepeval] → deepeval>=2.0,<4.0

The pytest plugin

The package ships a pytest plugin (entry point testrelic.deepeval.plugin) that auto-registers — there is nothing to import or configure.

  • Auto-capture. At pytest_sessionfinish, it captures DeepEval's global TestRun and uploads it.
  • No-op without credentials. If no API key or credentials are present, it logs a message and does nothing.
  • Never fails your tests. Upload exceptions are swallowed, so a reporting problem can never turn a green suite red.

The evaluate() wrapper

For programmatic evaluations outside pytest, import the wrapper:

from testrelic import evaluate

evaluate(test_cases, metrics, **kwargs) is a drop-in for deepeval.evaluate(): it runs the eval and then auto-uploads the result. The return value is whatever deepeval.evaluate() returns.

Upload path and offline queue

Results are uploaded to TestRelic's native /api/v1/evals/* API. The cloud endpoint defaults to the TestRelic production endpoint (https://platform.testrelic.ai/api/v1/evals); override it with TESTRELIC_CLOUD_ENDPOINT (the /evals path is appended for you) or TESTRELIC_BASE_URL (the full evals URL, used as-is).

If an upload cannot be delivered, it is written to a local offline queue at ~/.testrelic/queue/. Replay queued uploads later with testrelic drain (it needs an API key).

Next steps

Was this page helpful?

On this page