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>]
s...xx.
----------------------------------------------------------------------
Ran 7 tests in 463.69ms

OK (skipped=1, expected failures=2)

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

$ unittest-ft --randomize --stress-test [<module>]
.s...xs.xsxx.xx....xxx..xsxx.x.s.x...xs.xsxx....xx...s..ss............
----------------------------------------------------------------------
Ran 70 tests in 1.240s (saved 9.988s)

OK (skipped=10, expected failures=20)

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.4.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unittest_ft-0.4-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unittest_ft-0.4.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unittest_ft-0.4.tar.gz
Algorithm Hash digest
SHA256 9d7a8038730ee76fc3199683f78d2da18825b666379145e4a888f6b68534dc94
MD5 a492faef46cdbb5256c0e0edcf0da6a2
BLAKE2b-256 48c8cde308827a87a89cebe21f28ebcda955e7b86a37edbfac30281bbf6a68ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for unittest_ft-0.4.tar.gz:

Publisher: ci.yml on amyreese/unittest-ft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: unittest_ft-0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unittest_ft-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cbf584aef1785986f56e64dd19347019d8d1a707cf2d074fd7df98483b9e751c
MD5 ffa907456c8ab818f5ee86e61e5d26a4
BLAKE2b-256 863eaf7cbb6fd7cc895126d4c08b89987c6badb78a3c63fcd0dbc00c96498455

See more details on using hashes here.

Provenance

The following attestation bundles were made for unittest_ft-0.4-py3-none-any.whl:

Publisher: ci.yml on amyreese/unittest-ft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page