Install & Compatibility
Where this runs
tested against v3.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.738s · 34MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.3s · import 0.670s · 34MB
33MB installed
● package 33MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pytest_testrail
✓ import pytest_testrail
✗ from pytest_testrail import *
The plugin is typically auto-loaded by pytest; explicit import not required.
pytest_testrail.fixtures
✓ from pytest_testrail.fixtures import get_testrail_client
✗ from pytest_testrail import get_testrail_client
get_testrail_client moved to fixtures in v3.x.
Minimal setup: add marker @pytest.mark.testrail(id='C123') to tests, configure pytest.ini with TestRail credentials, and run pytest.
# conftest.py or test file
import os
import pytest
# Enable plugin via pytest.ini or pyproject.toml
# [pytest]
# testrail =
# url = https://your.testrail.com
# user = your_email
# password = your_password_or_api_key
# project_id = 1
# suite_id = 1
# run_name = Automated Run
# Test case must have testrail id marker
@pytest.mark.testrail(id='C123')
def test_example():
assert 1 + 1 == 2
# Or use dynamic assignment
from pytest_testrail.plugin import TestRail
# Optionally get client
from pytest_testrail.fixtures import get_testrail_client
def test_custom(client=get_testrail_client()):
# Use client directly if needed
assert client
assert True
Errors
Common errors & fixes
pytest: error: unrecognized arguments: --testrail
The plugin is not installed or not activated.
fixInstall pytest-testrail: pip install pytest-testrail. Ensure it is in the current environment.
ModuleNotFoundError: No module named 'pytest_testrail'
pytest-testrail is not installed or virtual environment not activated.
fixRun: pip install pytest-testrail. Check that you are in the correct virtual environment.
AttributeError: module 'pytest_testrail' has no attribute 'get_testrail_client'
Incorrect import path. get_testrail_client is in the fixtures submodule.
fixUse: from pytest_testrail.fixtures import get_testrail_client
Upgrade
Version history
3.1.1latest on PyPI · released Jan 25, 2026
Audit
Dependencies
pytestrequiredCore plugin dependency as a pytest plugin.
requestsrequiredUsed for communicating with TestRail API.