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.5.tar.gz (6.8 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.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unittest_ft-0.5.tar.gz
  • Upload date:
  • Size: 6.8 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.5.tar.gz
Algorithm Hash digest
SHA256 9db0123a7c642035d8df9d5faa66cf5efa2fa0d28fc1e2ab64c1d1098f106e7d
MD5 6ea8fb7788f236d54dbeffff860785be
BLAKE2b-256 551f4f0d2ca2c6bf87120a6d4c20f5e51e67503b090d25c535a21edd64589181

See more details on using hashes here.

Provenance

The following attestation bundles were made for unittest_ft-0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: unittest_ft-0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 223368b46df38c98b88b72040610e0d767caa011cd920560276b8d271d62aa17
MD5 8d48af9f759df98dda8985d6af3bfc94
BLAKE2b-256 f31b49701484dbc339c591edbe9d3b455d5b7eaa810a2afb1996a40841fc86dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for unittest_ft-0.5-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