Skip to main content

Official Testinel plugin for pytest

Testinel’s pytest plugin captures structured Selenium and Playwright test execution data directly from pytest and sends it to Testinel, where your test results become searchable, comparable, and actually useful. No log scraping. No brittle CI hacks. Just deterministic test analytics.

📦 Getting Started

Prerequisites

You need a Testinel account and project.

Installation

Getting Testinel into your project is straightforward. Just run this command in your terminal:

pip install --upgrade pytest-testinel

Or with uv:

uv add pytest-testinel

Configuration

Set Testinel reporter DSN environment variable TESTINEL_DSN. Get DSN for your project at https://testinel.dev/projects/.

Examples:

# Report to Testinel (HTTPS)
export TESTINEL_DSN="https://your.testinel.endpoint/ingest/xxxxxxxxxxxx/"
# Report to a local file (JSON)
export TESTINEL_DSN="file:///tmp/testinel-results.json"

# Or use a direct file path
export TESTINEL_DSN="./testinel-results.json"

Logging

Testinel uses pytest's standard logging controls.

To set the logging level to INFO for all pytest loggers and show the messages live, run:

pytest --log-level=INFO --log-cli-level=INFO

To change the level for pytest-testinel only, set its parent logger in your project's conftest.py:

import logging


def pytest_configure() -> None:
    logging.getLogger("pytest_testinel").setLevel(logging.INFO)

To also show these messages live, enable pytest's live logging:

pytest -o log_cli=true

Other loggers keep their existing levels. Replace INFO with DEBUG, WARNING, or another standard Python logging level as needed.

Use pytest's --log-file, --log-format, and related options to control log storage and formatting.

For better debugging and richer failure context, it is highly recommended to run pytest with:

--showlocals --tb=long -vv

Why:

  • --showlocals: includes local variable values in tracebacks, which makes root-cause analysis much faster.
  • --tb=long: shows full, non-truncated tracebacks so you can see complete failure paths.
  • -vv: increases verbosity, showing more detailed test identifiers and execution output.

Example:

pytest --showlocals --tb=long -vv

If you run browser tests with pytest-playwright, these flags provide better artifacts for debugging:

--tracing=retain-on-failure --video=retain-on-failure --screenshot=only-on-failure --output=test-results

Why:

  • --tracing=retain-on-failure: captures a full Playwright trace for failed tests only.
  • --video=retain-on-failure: keeps video recordings only for failed tests.
  • --screenshot=only-on-failure: saves screenshots at failure time.
  • --output=test-results: stores artifacts in a predictable directory.

Example:

pytest --tracing=retain-on-failure --video=retain-on-failure --screenshot=only-on-failure --output=test-results

Metadata

Release files for pytest-testinel 0.8.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-testinel 0.8.5
File Size Uploaded
pytest_testinel-0.8.5.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-testinel 0.8.5
File Interpreter ABI Platform
pytest_testinel-0.8.5-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / pytest_testinel-0.8.5.tar.gz

Download URL pytest_testinel-0.8.5.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cc7cb7087b5a7d1ddd6f45dc1d6c45617e1148bd24b849734431d8a8e1053339
BLAKE2b-256 checksum
How to use checksums
351defa2b3d30c1cbd93a02e19fac148e9ec4323311e53a437c6ee369a6aa10c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pytest_testinel-0.8.5-py3-none-any.whl

Download URL pytest_testinel-0.8.5-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c9239fa66702b6a2e47cd4035fc48fb9d086a5cf9247f106cab717802637eff
BLAKE2b-256 checksum
How to use checksums
69385c67191d9094a83e15181592cb138781350278e02bf01b550a203d7d37ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.8.5 This release

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page