Socket
Socket
Sign inDemoInstall

unittest-parallel

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unittest-parallel

Parallel unit test runner with coverage support


Maintainers
1

Readme

unittest-parallel

PyPI - Status PyPI GitHub PyPI - Python Version

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

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. 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. It was started using python-template 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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc