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.

Recommended pytest flags

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

Recommended Playwright flags

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_testinel-0.8.5.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_testinel-0.8.5-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest_testinel-0.8.5.tar.gz.

File metadata

  • Download URL: pytest_testinel-0.8.5.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for pytest_testinel-0.8.5.tar.gz
Algorithm Hash digest
SHA256 cc7cb7087b5a7d1ddd6f45dc1d6c45617e1148bd24b849734431d8a8e1053339
MD5 af9a04c4d74f13c8f0318862b3f5ab5d
BLAKE2b-256 351defa2b3d30c1cbd93a02e19fac148e9ec4323311e53a437c6ee369a6aa10c

See more details on using hashes here.

File details

Details for the file pytest_testinel-0.8.5-py3-none-any.whl.

File metadata

  • Download URL: pytest_testinel-0.8.5-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for pytest_testinel-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5c9239fa66702b6a2e47cd4035fc48fb9d086a5cf9247f106cab717802637eff
MD5 c6d079f161241c1de1439cd7cc155861
BLAKE2b-256 69385c67191d9094a83e15181592cb138781350278e02bf01b550a203d7d37ae

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.5 This release

2 files

0.8.4

2 files

0.8.3

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page