pytest-tcp


Namepytest-tcp JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/softwareTestingResearch/pytest-tcp
SummaryA Pytest plugin for test prioritization
upload_time2023-12-10 04:00:36
maintainersoftwareTestingResearch
docs_urlNone
authorsoftwareTestingResearch
requires_python>=3.5
licenseMIT
keywords pytest py.test test prioritization test order test ordering test ranking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==========
pytest-tcp
==========

.. image:: https://github.com/softwareTestingResearch/pytest-tcp/workflows/CI/badge.svg
    :target: https://github.com/softwareTestingResearch/pytest-tcp/actions?workflow=CI

.. image:: https://img.shields.io/pypi/pyversions/pytest-tcp.svg
    :target: https://pypi.org/project/pytest-tcp

.. image:: https://results.pre-commit.ci/badge/github/softwareTestingResearch/pytest-tcp/main.svg
   :target: https://results.pre-commit.ci/latest/github/softwareTestingResearch/pytest-tcp/main
   :alt: pre-commit.ci status


A Pytest plugin for test-case prioritization.

This `pytest`_ plugin allows you to find failures faster and receive sooner debugging feedback from CI.
It does so by prioritizing running tests that have shorter execution time and/or recently failed.


Installation
============

To install "pytest-tcp" via `pip`_ from `PyPI`_:

.. code-block:: bash

    pip install pytest-tcp


Usage
=====

Pytest will automatically find the plugin and use it when you run ``pytest``.
You can use the default prioritization heuristic,
which runs tests that have shorter execution time first
by passing the ``--tcp`` option:

.. code-block:: bash

    pytest --tcp

The terminal output will tell you the current configurations
and runtime overhead of this plugin::

    Using TCP weights 1-0
    Collect TCP features took 0.0029001235961914062s.
    Compute TCP order took 0.0002548694610595703s.

You can configure the weights of different prioritization heuristics
by additionally passing the ```--tcp-weight`` flag with formatted values:

.. code-block:: bash

    pytest --tcp --tcp-weight=0-1


Weights are separated by hyphens ``-``.
The 1st weight is for running faster tests,
the 2nd weight is for running recently failed tests.
The sum of all weights must equal to 1.
A higher weight means that a corresponding heuristic is favored.
The default value is ``1-0``, meaning it entirely favors running faster tests.


You can make these options always apply by adding them to the ``addopts`` setting in your
`pytest.ini <https://docs.pytest.org/en/latest/reference/customize.html#configuration>`_:

.. code-block:: ini

    [pytest]
    addopts = --tcp --tcp-weight=0.5-0.5


Contributing
============

Contributions are very welcome. Tests can be run with `tox`_.

License
=======

Distributed under the terms of the `MIT`_ license, "pytest-tcp" is free and open source software


Issues
======

If you encounter any problems, please `file an issue`_ along with a detailed description.


.. _`MIT`: http://opensource.org/licenses/MIT
.. _`file an issue`: https://github.com/softwareTestingResearch/pytest-tcp/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/softwareTestingResearch/pytest-tcp",
    "name": "pytest-tcp",
    "maintainer": "softwareTestingResearch",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "testingresearch4all@gmail.com",
    "keywords": "pytest,py.test,test prioritization,test order,test ordering,test ranking",
    "author": "softwareTestingResearch",
    "author_email": "testingresearch4all@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/03/50/ad58c683eeaf8fa2f1e2f8ff22fb99a1d88979913f4fd52366af4a772969/pytest-tcp-0.1.1.tar.gz",
    "platform": null,
    "description": "==========\npytest-tcp\n==========\n\n.. image:: https://github.com/softwareTestingResearch/pytest-tcp/workflows/CI/badge.svg\n    :target: https://github.com/softwareTestingResearch/pytest-tcp/actions?workflow=CI\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-tcp.svg\n    :target: https://pypi.org/project/pytest-tcp\n\n.. image:: https://results.pre-commit.ci/badge/github/softwareTestingResearch/pytest-tcp/main.svg\n   :target: https://results.pre-commit.ci/latest/github/softwareTestingResearch/pytest-tcp/main\n   :alt: pre-commit.ci status\n\n\nA Pytest plugin for test-case prioritization.\n\nThis `pytest`_ plugin allows you to find failures faster and receive sooner debugging feedback from CI.\nIt does so by prioritizing running tests that have shorter execution time and/or recently failed.\n\n\nInstallation\n============\n\nTo install \"pytest-tcp\" via `pip`_ from `PyPI`_:\n\n.. code-block:: bash\n\n    pip install pytest-tcp\n\n\nUsage\n=====\n\nPytest will automatically find the plugin and use it when you run ``pytest``.\nYou can use the default prioritization heuristic,\nwhich runs tests that have shorter execution time first\nby passing the ``--tcp`` option:\n\n.. code-block:: bash\n\n    pytest --tcp\n\nThe terminal output will tell you the current configurations\nand runtime overhead of this plugin::\n\n    Using TCP weights 1-0\n    Collect TCP features took 0.0029001235961914062s.\n    Compute TCP order took 0.0002548694610595703s.\n\nYou can configure the weights of different prioritization heuristics\nby additionally passing the ```--tcp-weight`` flag with formatted values:\n\n.. code-block:: bash\n\n    pytest --tcp --tcp-weight=0-1\n\n\nWeights are separated by hyphens ``-``.\nThe 1st weight is for running faster tests,\nthe 2nd weight is for running recently failed tests.\nThe sum of all weights must equal to 1.\nA higher weight means that a corresponding heuristic is favored.\nThe default value is ``1-0``, meaning it entirely favors running faster tests.\n\n\nYou can make these options always apply by adding them to the ``addopts`` setting in your\n`pytest.ini <https://docs.pytest.org/en/latest/reference/customize.html#configuration>`_:\n\n.. code-block:: ini\n\n    [pytest]\n    addopts = --tcp --tcp-weight=0.5-0.5\n\n\nContributing\n============\n\nContributions are very welcome. Tests can be run with `tox`_.\n\nLicense\n=======\n\nDistributed under the terms of the `MIT`_ license, \"pytest-tcp\" is free and open source software\n\n\nIssues\n======\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`file an issue`: https://github.com/softwareTestingResearch/pytest-tcp/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Pytest plugin for test prioritization",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/softwareTestingResearch/pytest-tcp"
    },
    "split_keywords": [
        "pytest",
        "py.test",
        "test prioritization",
        "test order",
        "test ordering",
        "test ranking"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "303ba87c0877cad65b943656094c513ff915ab92d37ddd0ff9d1da9c0959b660",
                "md5": "2977988f1b8f13aa8b60e8f1fe8f816c",
                "sha256": "2c826beaec2feb5286b5f526a9a91f5355607a893021e8396f181e01a04d7bd1"
            },
            "downloads": -1,
            "filename": "pytest_tcp-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2977988f1b8f13aa8b60e8f1fe8f816c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 6333,
            "upload_time": "2023-12-10T04:00:35",
            "upload_time_iso_8601": "2023-12-10T04:00:35.293056Z",
            "url": "https://files.pythonhosted.org/packages/30/3b/a87c0877cad65b943656094c513ff915ab92d37ddd0ff9d1da9c0959b660/pytest_tcp-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0350ad58c683eeaf8fa2f1e2f8ff22fb99a1d88979913f4fd52366af4a772969",
                "md5": "de5130f272f5e2d15cf64aad89eb7161",
                "sha256": "0c5cb0ab3b8115559f45847955355110f6554728eab2608fbc33be55215795ed"
            },
            "downloads": -1,
            "filename": "pytest-tcp-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "de5130f272f5e2d15cf64aad89eb7161",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 7126,
            "upload_time": "2023-12-10T04:00:36",
            "upload_time_iso_8601": "2023-12-10T04:00:36.890607Z",
            "url": "https://files.pythonhosted.org/packages/03/50/ad58c683eeaf8fa2f1e2f8ff22fb99a1d88979913f4fd52366af4a772969/pytest-tcp-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-10 04:00:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "softwareTestingResearch",
    "github_project": "pytest-tcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pytest-tcp"
}
        
Elapsed time: 0.20301s