Skip to main content

Pytest plugin for sending report to testrail system.

Project description

Pytest-Testrail-Reporter

Pytest-testrail-reporter is a pytest extension for reporting test results to Testrail.

Pytest-testrail-reporter gives an ability to send test results to specific testrail run or can create new one during test execution.

Installation

pip install pytest-testrail-integrator

Example

In order to link pytest test to testrail case you need to mark test with pytest.mark.case or tr_case decorator with testcase id passing as argument.

import pytest

from pytest_testrail_integrator import tr_case


@pytest.mark.case('98765')  # Use raw pytest marker.
def test_sum():
    assert 1 + 1 == 2


@tr_case('987654')  # Use custom decorator.
def test_divide():
    assert 2 / 1 == 2

Test case id must not start with "C" char and can be either string or integer.

Config for TestRail

  • All required configs can be loaded from virtual environment variables(higher priority) :
TR_RUN_ID
TR_API_URL
TR_USER_EMAIL
TR_USER_PASSWORD
TR_PROJECT_ID

Or

  • Add options to pytest.ini file.

Launch

In order to start tests with Pytest-Message you must provide --tr-reporting flag:

pytest tests --tr-reporting

All available command line options.

option description
--tr-reporting Create and update testruns with TestRail
--tr_deselect_tests If pass testrun id only. Selects only tests which have been marked with case decorator with appropriate case id. Other tests are marked as deselected and not started in test execution.

All available pytest.ini options.

option description
tr_api_url Testrail api url.
tr_run_id Testrail test run id. If passed test reports are linked to this particular test run.
tr_user_email Testrail User email for API authentication.
tr_user_password Testrail User password for API authentication.
tr_project_id Testrail Project Id. Required for new test run creation if Test Run Id is not passed.

Project details


Download files

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

Source Distribution

pytest-testrail-integrator-0.0.1b1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pytest-testrail-integrator-0.0.1b1.tar.gz.

File metadata

File hashes

Hashes for pytest-testrail-integrator-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 425c24a348b29e8e319bdc1014a05416339e475bcf8d1eb9389a27b28d578266
MD5 68555ab7495a7877231037751b1e7336
BLAKE2b-256 5394ec437fa60a7bf32a1b15c184a477a1549a22ee2c45dd79c101e7d2ebdefe

See more details on using hashes here.

File details

Details for the file pytest_testrail_integrator-0.0.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_testrail_integrator-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 815a263f33031b6ba44c606b805a9ddc5ee561aa44de6da5af3f57cc29e7b827
MD5 dba13d1e303dae47dccc322e2e5f3212
BLAKE2b-256 2d139532985dda435ab3ada1089c91c5d95c1a16ae81a65477f9973f83b37403

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page