Parallel test execution for Behave BDD via native ITestRunner.
Project description
behave-pool
Parallel test execution for Behave BDD via native ITestRunner.
Features
- Native ITestRunner — Registered via
--runner=orbehave.ini. Zero monkey-patching. - Dynamic dispatch —
multiprocessing.Process+Queue. Workers consume work units as they finish. - @serial tag — Non-parallelizable scenarios run sequentially after the parallel phase.
- LPT load balancing — Historical durations for optimal work distribution.
- Timing persistence —
.behave-pool-timing.jsonstores durations between runs. - Ecosystem integration — Optional
behave-priority,behave-modern-json-report. - Zero heavy dependencies — Only stdlib
multiprocessing+behave>=1.3.0.
Installation
pip install behave-pool
Quick start
- Register the runner in your
behave.ini:
[behave.runners]
parallel = behave_pool:ParallelRunner
- Run Behave with parallel workers:
behave --runner=parallel --parallel 4 --parallel-scheme feature features/
CLI options
| Option | Default | Description |
|---|---|---|
--parallel N |
1 |
Number of worker processes. 1 = sequential passthrough. |
--parallel-scheme |
feature |
Parallelization unit: feature (scenario planned for future). |
--parallel-balance |
lpt |
Work ordering: lpt (longest first) or fifo (insertion order). |
--parallel-timing-file |
.behave-pool-timing.json |
Path to timing file for LPT balancing. |
Usage
Feature-level parallelization
Each feature file runs in its own worker process. Workers are dispatched dynamically and consume work units from a shared queue.
# 4 worker processes, LPT balancing
behave --runner=parallel --parallel 4 features/
Serial scenarios
Tag scenarios with @serial to run them sequentially after all parallel work units complete:
@serial
Scenario: Database migration
Given the database is empty
When I run the migration
Then all tables should exist
LPT load balancing
By default, behave-pool uses Longest Processing Time (LPT) scheduling. It stores historical durations in .behave-pool-timing.json and dispatches the slowest features first, minimizing total wall-clock time.
# Use FIFO ordering instead of LPT
behave --runner=parallel --parallel 4 --parallel-balance fifo features/
behave.ini configuration
All CLI options can also be set in behave.ini:
[behave]
parallel = 4
parallel-scheme = feature
parallel-balance = lpt
parallel-timing-file = .behave-pool-timing.json
Requirements
- Python >=3.11
- behave >=1.3.0
Documentation
Full documentation is available at https://mathiaspaulenko.github.io/behave-pool/.
Contributing
Contributions are welcome! See CONTRIBUTING.md for setup instructions and guidelines.
Please review our Code of Conduct before participating.
Changelog
See CHANGELOG.md for notable changes.
License
MIT — Copyright (c) 2026 Mathias Paulenko
Acknowledgements
- Behave — the BDD framework this library extends.
- Contributor Covenant — Code of Conduct.
- Keep a Changelog — Changelog format.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file behave_pool-1.0.0.tar.gz.
File metadata
- Download URL: behave_pool-1.0.0.tar.gz
- Upload date:
- Size: 43.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51bd733787267b355d8a75712244703380e3522a66c9e6760b172221c0a8b9db
|
|
| MD5 |
2e214878cee72d27e8979d6e4fed58be
|
|
| BLAKE2b-256 |
192d5698b525c902549d36935131f673b53f7efb850f2b429fad09afc602ade1
|
Provenance
The following attestation bundles were made for behave_pool-1.0.0.tar.gz:
Publisher:
release.yml on MathiasPaulenko/behave-pool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
behave_pool-1.0.0.tar.gz -
Subject digest:
51bd733787267b355d8a75712244703380e3522a66c9e6760b172221c0a8b9db - Sigstore transparency entry: 2301381206
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/behave-pool@8210bc2a1e171a637e793e843252bf074a6719e3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8210bc2a1e171a637e793e843252bf074a6719e3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file behave_pool-1.0.0-py3-none-any.whl.
File metadata
- Download URL: behave_pool-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bddf412025abd9111b11d4714dbbd2d5507d674f8c07babbeb709645c92e892f
|
|
| MD5 |
17c49bfb5ff46f5002528da0fbeaf3c2
|
|
| BLAKE2b-256 |
456b805e03085a371953f72d5ac89b9fe972954f34e5a45378f8dc147403c893
|
Provenance
The following attestation bundles were made for behave_pool-1.0.0-py3-none-any.whl:
Publisher:
release.yml on MathiasPaulenko/behave-pool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
behave_pool-1.0.0-py3-none-any.whl -
Subject digest:
bddf412025abd9111b11d4714dbbd2d5507d674f8c07babbeb709645c92e892f - Sigstore transparency entry: 2301381302
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/behave-pool@8210bc2a1e171a637e793e843252bf074a6719e3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8210bc2a1e171a637e793e843252bf074a6719e3 -
Trigger Event:
workflow_dispatch
-
Statement type: