unittest-parallel


Nameunittest-parallel JSON
Version 1.6.0 PyPI version JSON
download
home_pagehttps://github.com/craigahobbs/unittest-parallel
SummaryParallel unit test runner with coverage support
upload_time2023-06-28 17:25:36
maintainer
docs_urlNone
authorCraig A. Hobbs
requires_python
licenseMIT
keywords test unittest coverage parallel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # unittest-parallel

[![PyPI - Status](https://img.shields.io/pypi/status/unittest-parallel)](https://pypi.org/project/unittest-parallel/)
[![PyPI](https://img.shields.io/pypi/v/unittest-parallel)](https://pypi.org/project/unittest-parallel/)
[![GitHub](https://img.shields.io/github/license/craigahobbs/unittest-parallel)](https://github.com/craigahobbs/unittest-parallel/blob/main/LICENSE)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unittest-parallel)](https://pypi.org/project/unittest-parallel/)

unittest-parallel is a parallel unit test runner for Python with coverage support.


## Links

- [Source code](https://github.com/craigahobbs/unittest-parallel)


## Run Unit Tests in Parallel

To run unittest-parallel, specify the directory containing your unit tests with the `-s` argument
and your package's top-level directory using the `-t` argument:

~~~
unittest-parallel -t . -s tests
~~~

By default, unittest-parallel runs unit test modules on all CPU cores available.

To run your unit tests with coverage, add either the `--coverage` option (for line coverage) or the
`--coverage-branch` for line and branch coverage.

~~~
unittest-parallel -t . -s tests --coverage-branch
~~~


## Parallelism Level

By default, unittest-parallel runs test modules in parallel, which works with
[test class and module fixtures](https://docs.python.org/3/library/unittest.html#class-and-module-fixtures).
If you don't have any module fixtures, you can use the `--level=class` option to run test classes in
parallel. If you don't have any module or class fixtures, you can use the `--level=test` option to
run individual tests in parallel.


## Do I Need unittest-parallel?

unittest-parallel helps the most when you have many long-running unit tests, such as those that make
web service calls or are compute-intensive. If you just have many fast-running unit tests,
unittest-parallel may slow down unit test execution due to the cost of parallelization.

For example, for one of my projects with thousands of compute-intensive unit tests, running tests
with unittest-parallel is **five times faster** than running tests using Python's built-in unit test
runner.

For another project, with hundreds of fast-running unit tests, running tests using unittest-parallel
is **twice as slow** as running them using Python's built-in unit test runner.

To determine if unittest-parallel will improve your unit test run times, you'll need to try it on
your project.


## Development

This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:

~~~
template-specialize python-template/template/ unittest-parallel/ -k package unittest-parallel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k noapi 1
~~~

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/craigahobbs/unittest-parallel",
    "name": "unittest-parallel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "test,unittest,coverage,parallel",
    "author": "Craig A. Hobbs",
    "author_email": "craigahobbs@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3f/6f/75468a8446684f92bc03fe70b1c79661cb63955d7aedcc16ffb1fb093d15/unittest-parallel-1.6.0.tar.gz",
    "platform": null,
    "description": "# unittest-parallel\n\n[![PyPI - Status](https://img.shields.io/pypi/status/unittest-parallel)](https://pypi.org/project/unittest-parallel/)\n[![PyPI](https://img.shields.io/pypi/v/unittest-parallel)](https://pypi.org/project/unittest-parallel/)\n[![GitHub](https://img.shields.io/github/license/craigahobbs/unittest-parallel)](https://github.com/craigahobbs/unittest-parallel/blob/main/LICENSE)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unittest-parallel)](https://pypi.org/project/unittest-parallel/)\n\nunittest-parallel is a parallel unit test runner for Python with coverage support.\n\n\n## Links\n\n- [Source code](https://github.com/craigahobbs/unittest-parallel)\n\n\n## Run Unit Tests in Parallel\n\nTo run unittest-parallel, specify the directory containing your unit tests with the `-s` argument\nand your package's top-level directory using the `-t` argument:\n\n~~~\nunittest-parallel -t . -s tests\n~~~\n\nBy default, unittest-parallel runs unit test modules on all CPU cores available.\n\nTo run your unit tests with coverage, add either the `--coverage` option (for line coverage) or the\n`--coverage-branch` for line and branch coverage.\n\n~~~\nunittest-parallel -t . -s tests --coverage-branch\n~~~\n\n\n## Parallelism Level\n\nBy default, unittest-parallel runs test modules in parallel, which works with\n[test class and module fixtures](https://docs.python.org/3/library/unittest.html#class-and-module-fixtures).\nIf you don't have any module fixtures, you can use the `--level=class` option to run test classes in\nparallel. If you don't have any module or class fixtures, you can use the `--level=test` option to\nrun individual tests in parallel.\n\n\n## Do I Need unittest-parallel?\n\nunittest-parallel helps the most when you have many long-running unit tests, such as those that make\nweb service calls or are compute-intensive. If you just have many fast-running unit tests,\nunittest-parallel may slow down unit test execution due to the cost of parallelization.\n\nFor example, for one of my projects with thousands of compute-intensive unit tests, running tests\nwith unittest-parallel is **five times faster** than running tests using Python's built-in unit test\nrunner.\n\nFor another project, with hundreds of fast-running unit tests, running tests using unittest-parallel\nis **twice as slow** as running them using Python's built-in unit test runner.\n\nTo determine if unittest-parallel will improve your unit test run times, you'll need to try it on\nyour project.\n\n\n## Development\n\nThis package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).\nIt was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:\n\n~~~\ntemplate-specialize python-template/template/ unittest-parallel/ -k package unittest-parallel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k noapi 1\n~~~\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Parallel unit test runner with coverage support",
    "version": "1.6.0",
    "project_urls": {
        "Homepage": "https://github.com/craigahobbs/unittest-parallel"
    },
    "split_keywords": [
        "test",
        "unittest",
        "coverage",
        "parallel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80351d95277091558c9955e79cbe30a30f3f4820071aced304edc10c5eff4e02",
                "md5": "0d7237e998217a2076df7a9acf379b70",
                "sha256": "6014a745144f620a1a3b4bea0f6d9678d02d2ab67bb70e1b0277543917236fb0"
            },
            "downloads": -1,
            "filename": "unittest_parallel-1.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0d7237e998217a2076df7a9acf379b70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7971,
            "upload_time": "2023-06-28T17:25:35",
            "upload_time_iso_8601": "2023-06-28T17:25:35.297123Z",
            "url": "https://files.pythonhosted.org/packages/80/35/1d95277091558c9955e79cbe30a30f3f4820071aced304edc10c5eff4e02/unittest_parallel-1.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f6f75468a8446684f92bc03fe70b1c79661cb63955d7aedcc16ffb1fb093d15",
                "md5": "f58d18a35eef62149898abae87a380da",
                "sha256": "1a17ec895d11ea61cb38c643bc6b1fd2c3643ef117472d3b521b476c91491b8f"
            },
            "downloads": -1,
            "filename": "unittest-parallel-1.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f58d18a35eef62149898abae87a380da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8120,
            "upload_time": "2023-06-28T17:25:36",
            "upload_time_iso_8601": "2023-06-28T17:25:36.759812Z",
            "url": "https://files.pythonhosted.org/packages/3f/6f/75468a8446684f92bc03fe70b1c79661cb63955d7aedcc16ffb1fb093d15/unittest-parallel-1.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-28 17:25:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "craigahobbs",
    "github_project": "unittest-parallel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "unittest-parallel"
}
        
Elapsed time: 0.08353s