Skip to main content

PyPI Downloads PyPI - Python Version PyPI - Implementation Pytest Version Build Status codecov

pytest-pytestrail

Pytest plugin for interaction with TestRail

Install

pip install pytest-pytestrail-internal

Example

from pytest_pytestrail import pytestrail


@pytestrail.case('C32')
def test_one():
    assert True

@pytestrail.case('C12')
def test_two():
    assert True
Steps
from pytest_pytestrail import pytestrail

case = pytestrail.steps_case('C3')

@case.step(1)
def test_step_one():
    assert True


@case.step(2)
def test_step_two():
    assert True
Steps parametrize
from pytest_pytestrail import pytestrail
import pytest

@pytest.mark.parametrize('data', pytestrail.params('C84', [1, 23, 33, 1, 57]))
def test_five(data):
    assert data

@pytest.mark.parametrize('data', [pytestrail.param(1, 'C55'), pytestrail.param(2, 'C56')])
def test_six(data):
    assert data

Configuration

Support environment variables

  • TESTRAIL_URL
  • TESTRAIL_EMAIL
  • TESTRAIL_PASSWORD
Config file

pytest.ini or setup.cfg pytest configuration

[pytest]
pytestrail (bool):                       Enable plugin
pytestrail-url (string):                 TestRail address
pytestrail-email (string):               Email for the account on the TestRail
pytestrail-password (string):            Password for the account on the TestRail
pytestrail-test-run (string):            ID testrun
pytestrail-no-decorator-skip (bool):     Skip tests without decorator
pytestrail-report (bool):                Enable report
pytestrail-no-ssl-check (bool):          Do not check for valid SSL certificate on TestRail host
pytestrail-project-id (string):          ID of the project
pytestrail-suite-id (string):            ID of the test suite
pytestrail-testrun-name (string):        Name given to testrun, that appears in TestRail
pytestrail-date-format (string):         Date format (default: %Y-%m-%d %H:%M:%S)
pytestrail-tz-local (bool):              Use local time zone (Default: UTC)
pytestrail-close-on-complete (bool):     Close test run on completion
pytestrail-milestone-id (string):        Set test tun milestone
pytestrail-testrun-description (string): Description given to testrun, that appears in TestRail

or

Command line options
--pytestrail                                    Enable plugin
--tr-url=TR_URL                                 TestRail address
--tr-email=TR_EMAIL                             Email for the account on the TestRail
--tr-password=TR_PASSWORD                       Password for the account on the TestRail
--tr-test-run=TR_TEST_RUN                       ID testrun
--tr-no-decorator-skip                          Skip tests without decorator
--tr-report                                     Enable report
--tr-no-ssl-check                               Do not check for valid SSL certificate on TestRail host
--tr-project-id=TR_PROJECT_ID                   ID of the project
--tr-suite-id=TR_SUITE_ID                       ID of the test suite
--tr-testrun-name=TR_TESTRUN_NAME               Name given to testrun, that appears in TestRail
--tr-date-format=TR_DATE_FORMAT                 Date format (default: %Y-%m-%d %H:%M:%S)
--tr-tz-local                                   Use local time zone (Default: UTC)
--tr-close-on-complete                          Close test run on completion
--tr-milestone-id=TR_MILESTONE_ID               Set test tun milestone
--tr-testrun-description=TR_TESTRUN_DESCRIPTION Description given to testrun, that appears in TestRail

Metadata

Release files for pytest-pytestrail-internal 0.0.2

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-pytestrail-internal 0.0.2
File Size Uploaded
pytest_pytestrail_internal-0.0.2.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-pytestrail-internal 0.0.2
File Interpreter ABI Platform
pytest_pytestrail_internal-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / pytest_pytestrail_internal-0.0.2.tar.gz

Download URL pytest_pytestrail_internal-0.0.2.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1617923fca1c61cb590dad1e2f788b81691c3073fc24d415e4e397663670a423
BLAKE2b-256 checksum
How to use checksums
b275ad2f00abf8cbf33814a17cfd071a9a9543cd8a98046e809cf604bb15bd52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pytest_pytestrail_internal-0.0.2-py3-none-any.whl

Download URL pytest_pytestrail_internal-0.0.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4d621c7bf7fdc9324298cf97c6edcbb084c2d33347e3f7a25502ea6d73690c4
BLAKE2b-256 checksum
How to use checksums
a0cc8fa33d3fdcf061c0da1f6ef974310448a3650f2360b52a57c2e2381daddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

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