pytest-pytestrail
Pytest plugin for interaction with TestRail
What it is and what it does
pytest-pytestrail is a pytest plugin that bridges your test suite to TestRail, a test case management platform. It lets you decorate individual pytest test functions with TestRail case IDs, then automatically report pass/fail results back to TestRail during test execution. You can also organize tests into steps, parametrize them with multiple data sets, and create named test runs with metadata like milestones and descriptions.
The plugin is configured through pytest.ini, setup.cfg, environment variables, or command-line flags. It handles authentication to TestRail, manages test run lifecycle (creation, result reporting, optional closure on completion), and supports timezone handling and custom date formatting. However, the package has been abandoned since early 2022 and receives no updates, so compatibility with newer pytest or TestRail API versions is not guaranteed.
Use it for:
- Automatically sync pytest test results to TestRail after each test run without manual reporting.
- Link automated tests to TestRail case IDs so test execution history is tracked in your test management system.
- Organize multi-step tests in pytest and report each step's result separately to TestRail.
- Parametrize pytest tests and report each parameter variant as a distinct TestRail case result.
- Create and close TestRail test runs programmatically from CI/CD pipelines during automated testing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that decorates test functions to report results to TestRail, linking individual test cases by ID and optionally creating test runs with parametrized steps.
No—not for new projects. The package is abandoned (last update 2020-08-27, repository archived), so it will not receive bug fixes or compatibility updates. If you need TestRail integration with pytest, consider actively maintained alternatives or evaluate whether the risk of incompatibility with future pytest and TestRail API versions is acceptable for your use case. Only install if you are maintaining legacy code already using this plugin and cannot migrate.
Install
pytest-pytestrail on PyPI
pip
pip install pytest-pytestrailuv
uv add pytest-pytestrailpoetry
poetry add pytest-pytestrailInstalling pytest-pytestrail
Before you install
Low install friction with only two runtime dependencies (pytest and testrail-api). However, the package is abandoned—last commit was 2022-01-15 and the repository is archived. No updates have been released since 2020-08-27, meaning it will not receive bug fixes or compatibility updates for newer pytest or TestRail API versions.
License in practice
MIT License (permissive) means you can use, modify, and distribute the package freely with minimal restrictions, though you should include the license notice.
Quickstart
pip install pytest-pytestrail
from pytest_pytestrail import pytestrail
@pytestrail.case('C32')
def test_one():
assert True
Requires TestRail account credentials (TESTRAIL_URL, TESTRAIL_EMAIL, TESTRAIL_PASSWORD) set via environment variables or pytest configuration file.
Verify before relying
- Whether the package remains compatible with current TestRail API versions and recent pytest releases.
- Whether testrail-api dependency has active maintenance and security updates.
- Whether SSL certificate validation bypass (--tr-no-ssl-check) introduces security risks in production environments.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest, testrail-api |
| Maintenance | abandoned — 2,178 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 565,669/month — #5,973 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_pytestrail-0.10.5-py2.py3-none-any.whl
Keywords: testrail, pytest, pytest-testrail, pytest-pytestrail, testrail_api, api
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-testrailA pytest plugin that integrates test execution…
permissive · top 15,000 on PyPI
tdd-guard-pytestA pytest plugin that captures test results and…
permissive · top 15,000 on PyPI
testrail-apiA Python wrapper for the TestRail API that lets…
permissive · top 5,000 on PyPI
pytest-loggerPytest-logger is a pytest plugin that…
permissive · top 15,000 on PyPI
trcliA command-line tool for uploading test…
unclear · top 15,000 on PyPI
pytest-catchlogA pytest plugin that automatically captures log…
permissive · top 15,000 on PyPI
pytest-pspecFormats pytest test output in RSpec-style…
permissive · top 15,000 on PyPI
pytest-specpytest-spec is a pytest plugin that reformats…
copyleft · top 15,000 on PyPI
pytest-excelA pytest plugin that generates Excel reports…
permissive · top 15,000 on PyPI
parametrizeProvides a `@parametrize` decorator that works…
permissive · top 15,000 on PyPI