{"id":16252180,"url":"https://github.com/jsfehler/pytest-testrail2","last_synced_at":"2025-10-03T13:49:20.739Z","repository":{"id":65611293,"uuid":"569794519","full_name":"jsfehler/pytest-testrail2","owner":"jsfehler","description":"A pytest plugin to upload results to TestRail.","archived":false,"fork":false,"pushed_at":"2023-02-10T16:27:42.000Z","size":99,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T00:14:11.232Z","etag":null,"topics":["pytest","python","python3","testing","testrail","testrail-reporting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsfehler.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T16:19:16.000Z","updated_at":"2025-02-21T16:37:04.000Z","dependencies_parsed_at":"2023-02-23T13:31:39.988Z","dependency_job_id":null,"html_url":"https://github.com/jsfehler/pytest-testrail2","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.06060606060606055,"last_synced_commit":"cd4c591dd1133d0e58a216ab16087ec544af208d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fpytest-testrail2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fpytest-testrail2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fpytest-testrail2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fpytest-testrail2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsfehler","download_url":"https://codeload.github.com/jsfehler/pytest-testrail2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247726444,"owners_count":20985903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytest","python","python3","testing","testrail","testrail-reporting"],"created_at":"2024-10-10T15:12:43.837Z","updated_at":"2025-10-03T13:49:15.706Z","avatar_url":"https://github.com/jsfehler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"++++++++++++++++\npytest-testrail2\n++++++++++++++++\n\nCreate and update testplans and/or testruns in TestRail based on pytest results.\nTest functions marked with a TestRail case ID will have their results sent to TestRail.\n\nThis project preserves the functionality of the deprecated `pytest-testrail \u003chttps://github.com/allankp/pytest-testrail/\u003e`_ project.\n\n.. image:: https://img.shields.io/pypi/v/pytest-testrail2.svg\n    :target: https://pypi.org/project/pytest-testrail2\n    :alt: PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-testrail2.svg\n    :alt: PyPI - Python Version\n    :target: https://github.com/jsfehler/pytest-testrail2\n\n.. image:: https://img.shields.io/github/license/jsfehler/pytest-testrail2.svg\n   :alt: GitHub\n   :target: https://github.com/jsfehler/pytest-testrail2/blob/master/LICENSE\n\n.. image:: https://github.com/jsfehler/pytest-testrail2/workflows/CI/badge.svg\n   :target: https://github.com/jsfehler/pytest-testrail2/actions/workflows/main.yml\n   :alt: Build status\n\n\nKey features:\n\n- Configurable: Handle results in whichever way makes sense for your project.\n- Powerful: Handle complex use cases via a simple interface to the TestRail API.\n- Flexible: Fully compatible with pytest.parametrize(), pytest-xdist, and pytest-rerunfailures.\n\nExample\n=======\n\n.. code:: python\n\n  import pytest\n\n  @pytest.mark.case_id('C1950')\n  def test_all_the_things():\n    doit = True\n    assert doit\n\nGetting Started\n===============\n\nInstallation\n------------\n\nVia pip:\n\n.. code-block:: bash\n\n   pip install pytest-testrail2\n\n\nPlugin Configuration\n--------------------\n\nThe following values are required:\n\n- A valid TestRail instance URL.\n- A valid email address for a user on the instance.\n- A valid API key for the user.\n\nThey can be set on the command line via the follow flags:\n\n.. code-block:: bash\n\n  --tr-url=\u003cyour_url\u003e\n  --tr-email=\u003cyour_email\u003e\n  --tr-password=\u003cyour_password\u003e\n\nAlternatively, they can be set via a pytest configuration file:\n\n.. code-block:: ini\n\n  [pytest]\n    tr_url=\u003cyour_url\u003e\n    tr_email=\u003cyour_email\u003e\n    tr_password=\u003cyour_password\u003e\n\n\nMarking Tests\n-------------\n\ncase_id\n~~~~~~~\n\nThe `case_id` marker takes a string which must match an existing TestRail testcase.\nOnly tests with this marker will be added to the TestRail testrun.\n\n.. code:: python\n\n  import pytest\n\n  # This test's results will be uploaded.\n  @pytest.mark.case_id('C1950')\n  def test_all_the_things():\n    ...\n\n\n  # This test's results will not be uploaded.\n  def test_all_the_other_things():\n    ...\n\ndefect_ids\n~~~~~~~~~~\n\nThe 'defect_ids' marker takes a list of strings. These will be used in the `defect`\nfield in TestRail. This is useful for tests with known failures.\n\nTypically these are IDs for your bug tracking software.\n\n.. code:: python\n\n  import pytest\n\n  @pytest.mark.case_id('C1950')\n  @pytest.mark.defect_ids(['JS-7001', 'JS-9001'])\n  def test_all_the_things():\n    ...\n\nRunning Pytest\n--------------\n\nThe `--testrail` command-line flag must be present to upload results:\n\n.. code-block:: bash\n\n  pytest --testrail\n\n\nOptions\n=======\n\nSetup\n-----\n\n- ``--testrail``\n  Activate the TestRail plugin.\n\n- ``--tr-url``\n  Web address used to access a TestRail instance.\n\n- ``--tr-email``\n  E-mail address for an account on the TestRail instance.\n\n- ``--tr-password``\n  Password for an account on the TestRail instance.\n\n- ``--tr-timeout``\n  Timeout for connecting to a TestRail server.\n\n- ``--tr-no-ssl-cert-check``\n  Do not check for valid SSL certificate on TestRail host.\n\nTestrun\n-------\n\n- ``--tr-run-id``\n  ID of an existing testrun in TestRail.\n  If specified, the testrun matching the ID will be used instead of creating a new testrun.\n  If given, ``--tr-testrun-name`` will be ignored.\n\n- ``--tr-testrun-name``\n  Name used for a new testrun in TestRail.\n\n- ``--tr-testrun-description``\n  Description used for a new testrun in TestRail.\n\n- ``--tr-testrun-assignedto-id``\n  ID of the user to be assigned to the testrun.\n\n- ``--tr-testrun-project-id``\n  ID of the project the testrun will be created in.\n\n- ``--tr-testrun-suite-id``\n  ID of the suite the testrun will be created in.\n\n- ``--tr-testrun-suite-include-all``\n  Include all test cases in the specified testsuite for a new testrun.\n\n- ``--tr-milestone-id``\n  ID of milestone used in testrun creation.\n\n- ``--tr-skip-missing``\n  Skip pytest test functions with marks that are not present in a specified testrun.\n\nTestplan\n--------\n\n- ``--tr-plan-id``\n  ID of an existing testplan to use. If given, ``--tr-testrun-name`` will be ignored.\n\nPublishing\n----------\n\n- ``--tr-version``\n  Specify a version in testcase results.\n\n- ``--tr-close-on-complete``\n  On pytest completion, close the testrun.\n\n- ``--tr-dont-publish-blocked``\n  Do not publish results of \"blocked\" testcases (in TestRail).\n\n- ``--tr-custom-comment``\n  Custom text appended to comment for all testcase results.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsfehler%2Fpytest-testrail2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsfehler%2Fpytest-testrail2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsfehler%2Fpytest-testrail2/lists"}