Skip to main content

Run tests in parallel with free threading

Project description

unittest-ft

Run Python tests in parallel with free threading

version license

Alternative to the standard unittest runner that spawns a thread pool, and runs every test individually on separate threads, in parallel, to both run tests faster and to assist with validating the thread safety of the tested system.

unittest-ft also includes options to run "stress tests" which queues every test to be run ten times rather than just once, as well as randomizing the test order every time to help catch unintended test order dependencies.

This is intended for use with Python 3.13 or newer with Free Threading enabled, but is functionally compatible back to Python 3.8 for use in multi-version CI.

Install

$ pip install unittest-ft

Usage

Run your test suite:

$ unittest-ft <module>
...

----------------------------------------------------------------------
Ran 7 tests in 497.55ms (saved 0.41ms)

If you can spare the time/cores, run a randomized stress test:

$ unittest-ft --randomize --stress-test <module>
...

----------------------------------------------------------------------
Ran 70 tests in 1.306s (saved 10.679s)

License

unittest-ft is copyright Amethyst Reese, and licensed under the MIT license.

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

unittest_ft-0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

unittest_ft-0.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file unittest_ft-0.2.tar.gz.

File metadata

  • Download URL: unittest_ft-0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for unittest_ft-0.2.tar.gz
Algorithm Hash digest
SHA256 a45ed46ce358912819551232d7ad8ab408f754ad4960ffb7216cbbbb628bec6c
MD5 c1a0647ad71684d1a7a2a5e2336e829b
BLAKE2b-256 b20b6476323520764a900565ba32aa191709a201285071a4343ef00a4265a35e

See more details on using hashes here.

File details

Details for the file unittest_ft-0.2-py3-none-any.whl.

File metadata

  • Download URL: unittest_ft-0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for unittest_ft-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76e43a1f6cd819556ea6eba988856f8e8ac3815df7569f1f730fe98cca9e9172
MD5 64cad45690222283dd0bf901945c5eb1
BLAKE2b-256 d3d4cd5bdadbb3e2f9fc71d49fbf6f18a8f2272a553c6a9cc274e3060575c728

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