skillfed

pytest-testrail

A pytest plugin for creating TestRail runs and adding results

pytest-testrail v3.1.1 123.3K downloads/30d#11,913 on PyPI97
Permissive license MIT AGING released

What it is and what it does

pytest-testrail is a pytest plugin that bridges test execution and TestRail test management. It reads pytest markers to identify which tests should be added to a TestRail test run, executes them, and automatically pushes results back to TestRail. The plugin handles test run creation, result updates, and defect tracking integration.

Version 3.1.1 is a modernized release requiring Python 3.10+, with full type hints, API key authentication (recommended over passwords), connection pooling via requests, automatic retry on rate limiting, and proper exception handling. It depends on pytest and requests, and supports TestRail API pagination for TestRail 6.7+. Configuration is done via INI file or command-line options, and the plugin can be used both as a pytest plugin or as a standalone APIClient for programmatic access.

Use it for:

  • Automatically create and populate TestRail test runs from pytest test suites marked with @pytestrail.case decorators.
  • Push test results back to TestRail after pytest execution, keeping test management synchronized with CI/CD pipelines.
  • Link test failures to defects in Jira or other tracking systems using @pytestrail.defect markers.
  • Query TestRail data programmatically via the APIClient for custom reporting or test orchestration.
  • Handle paginated TestRail API responses when working with large test case inventories.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pytest plugin that integrates test execution with TestRail, automatically creating test runs and updating results in TestRail based on pytest markers.

Yes, if you use TestRail and pytest together. The plugin has low install friction, permissive licensing, no known vulnerabilities, and is actively maintained (last commit January 2026). The aging maintenance status (201 days since last release) is not a blocker for stable integrations, but verify that your TestRail version and API requirements align before deploying to production.

Install

pytest-testrail on PyPI

pip

pip install pytest-testrail

uv

uv add pytest-testrail

poetry

poetry add pytest-testrail

Installing pytest-testrail

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 201 days ago—but the repository remains active and not archived, with recent commits as of 2026-01-25.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution for commercial or private projects.

Quickstart

pip install pytest-testrail

from pytest_testrail.plugin import pytestrail

@pytestrail.case('C1234')
def test_example():
    pass

# Run with: pytest --testrail --tr-config=testrail.cfg

Requires Python 3.10 or later; TestRail server credentials (URL, email/API key, project/suite IDs) must be configured via config file or command-line options.

Verify before relying

  • Whether automatic retry on rate limiting (HTTP 429) is fully tested under production load.
  • Compatibility with TestRail versions older than 6.7 (pagination support requires 6.7+).
  • Performance characteristics when handling large test suites with connection pooling.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pytest, requests
Maintenance aging — 201 days since the last release
Last repo commit
First released
Downloads 123,329/month — #11,913 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_testrail-3.1.1-py3-none-any.whl

Keywords: pytest, qa, test-management, testing, testrail

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTyping :: Typed

Tags

pytest testrail integrationtest rail automationpytest test managementtestrail api clientautomated test reportingpytest markers testrailtest run creation automation
test-managementtestrail-integrationci-cd

More Testing packages