Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Tests Maintenance Known Vulnerabilities PyPI version shields.io PyPI pyversions codecov Downloads License: MIT

Test Junkie

The Python test runner built for precision.
▸ Zero plugins. Full arsenal.

Test Junkie Share on X

Test Junkie is a Python test runner and test framework with built-in parallel test execution, exception-aware retries, multi-layer parametrization, event listeners and HTML/XML reports — everything in one package, no plugins. Use it from Python with Runner or from the terminal with the tj command.

Key Features

Not a wrapper around unittest. Every capability below ships with the library — no plugins to install, no config files to write, no external orchestrators.

  • Decorator-based: @Suite and @test on plain Python classes — no base class to extend, no config file to maintain
  • Lifecycle hooks: @beforeClass, @afterClass, @beforeTest, @afterTest on the class, plus @beforeGroup / @afterGroup (via @GroupRules) that run once around a named set of suites
  • Built-in parallel execution: separate thread limits for suites (-S / suite_multithreading_limit) and tests (-T / test_multithreading_limit); parallelized=False keeps a suite or test out of the parallel pool, and pr=[...] stops specific suites or tests from ever overlapping
  • Retries: retry=N on a suite or a test — only the failing parameter variants re-run; retry_on=[ConnectionError] retries just infrastructure noise, no_retry_on=[AssertionError] makes real bugs surface immediately
  • Multi-layer parametrization: @Suite(parameters=[...]) × @test(parameters=[...]) = every combination, each variant tracked and retried on its own; parameters can be a function that builds the list at run time
  • Rules for shared setup/teardown — define before_class / before_test / … once, attach with @Suite(rules=...) to as many suites as you like
  • First-class owner, feature, component, tags and priority — filter with tj run --owners, --features, --components, --run_on_match_any / --run_on_match_all (tags), or owners= / features= / components= / tag_config= in Runner.run()
  • Execution order per suite: @Suite(order=TestOrder.RANDOM) (or ALPHABETICAL, PRIORITY_ASC, PRIORITY_DESC) — e.g. shuffle one suite to surface order dependencies
  • Skipping: skip=True or a function deciding at run time on any suite or test, and shortcuts.skip("reason") from inside a running test
  • Live event listeners: subclass Listener, override any of its 21 events (on_failure, on_success, on_class_skip, …) and attach it with @Suite(listener=...)
  • Results as objects: runner.get_executed_suites() returns typed suite/test objects with status, timing, retries, exceptions and metadata; Meta.update(...) adds to a test's metadata while it runs
  • Reports: HTML (with CPU and memory graphs when monitor_resources=True) and XML, written to the paths you pass as html_report= / xml_report=; the JSON-ready report data is also returned by runner.run()
  • CLI: tj run, tj audit, tj config — run and inspect suites without writing a runner script; tj run exits non-zero on failures, errors or when nothing ran, ready for CI

And more →

Installation

pip install test-junkie

Quick example

from test_junkie.decorators import Suite, test, beforeClass
from test_junkie.runner import Runner


@Suite(feature="Login", owner="qa-team")
class LoginSuite:

    @beforeClass()
    def open_session(self):
        self.session = {"user": "demo"}

    @test(component="auth", tags=["smoke"], retry=2)
    def valid_login(self):
        assert self.session["user"] == "demo"

    @test(component="auth", parameters=["", "wrong-password"])
    def invalid_login(self, parameter):
        assert parameter != "correct-password"


if __name__ == "__main__":
    Runner([LoginSuite], html_report="report.html").run(test_multithreading_limit=4)

Or from the terminal: tj run -s path/to/tests -T 4 --html_report report.html

Python 2.7: the last release with Python 2.7 support is 0.8a.8. All versions from 0.9a0 onwards require Python 3.

Performance

Everything above ships in one package — no plugins to add for parallel runs or parametrization.

Package footprint — installed size, including the plugins each framework needs to match those features:

Framework Core (KB) Parallel Parametrization Total (KB)
test_junkie 621 built-in built-in 621
unittest 528 built-in (ThreadPoolExecutor) +139 (parameterized) 667
pytest 2,932 +532 (pytest-xdist) built-in 3,464
Robot Framework 5,980 +539 (robotframework-pabot) built-in 6,519

Wall clock — N tests that each sleep 1 ms, process start to exit (median of 30 runs; every run verified to have passed all N tests):

Framework N = 1 N = 100 N = 1,000 N = 1,000 · 10 workers
test_junkie 95 ms 296 ms 1,972 ms 308 ms
unittest 92 ms 289 ms 2,028 ms 268 ms ¹
pytest 296 ms 573 ms 2,741 ms 2,064 ms (pytest-xdist)
Robot Framework 308 ms 581 ms 3,395 ms 85.3 s (pabot) ²

¹ a bare ThreadPoolExecutor with no test runner. ² median of 3 runs; pabot starts a process per test.

Measured with test_junkie 0.9a5, pytest 9.1.1, Robot Framework 7.5 on Python 3.12.5 (Windows 11, Intel Core i9-10980HK). Parametrized and parallel results, per-phase timings and the exact commands are in the full benchmark →

Getting Started

Getting Started Guide   Full Documentation


Changelog    Report a Bug

Metadata

Release files for test-junkie 0.9a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for test-junkie 0.9a5
File Size Uploaded Provenance
test_junkie-0.9a5.tar.gz 76.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for test-junkie 0.9a5
File Interpreter ABI Platform
test_junkie-0.9a5-py3-none-any.whl Python 3 none any Details

Total release size: 157.8 kB

Release files / test_junkie-0.9a5.tar.gz

Download URL test_junkie-0.9a5.tar.gz
Size 76.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6267e8e1a2f73e918110786cd2e50da4daa58993a057fe3b3bb72410d2efdef2
BLAKE2b-256 checksum
How to use checksums
569373b1a4033ed18ec95b2402849ecdd186075e643af5af84dc86bdefcf6b82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / test_junkie-0.9a5-py3-none-any.whl

Download URL test_junkie-0.9a5-py3-none-any.whl
Size 81.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94b83a61b0cdaf8618c17a262e45973cf7412c356b75de036def8ba7f7f811d6
BLAKE2b-256 checksum
How to use checksums
6e3da7db1fdd1db1ab0ed76f487605a6c8c3c82a131f168c173d3872723aabce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Security for test-junkie 0.9a5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for test_junkie-0.9a5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page