Skip to main content

Parallel test execution for Behave BDD via native ITestRunner.

Project description

behave-pool

CI Documentation Python PyPI License Code style: ruff

Parallel test execution for Behave BDD via native ITestRunner.

Features

  • Native ITestRunner — Registered via --runner= or behave.ini. Zero monkey-patching.
  • Dynamic dispatchmultiprocessing.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.json stores 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

  1. Register the runner in your behave.ini:
[behave.runners]
parallel = behave_pool:ParallelRunner
  1. 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

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

behave_pool-1.0.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

behave_pool-1.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

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

Hashes for behave_pool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 51bd733787267b355d8a75712244703380e3522a66c9e6760b172221c0a8b9db
MD5 2e214878cee72d27e8979d6e4fed58be
BLAKE2b-256 192d5698b525c902549d36935131f673b53f7efb850f2b429fad09afc602ade1

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_pool-1.0.0.tar.gz:

Publisher: release.yml on MathiasPaulenko/behave-pool

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

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

Hashes for behave_pool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bddf412025abd9111b11d4714dbbd2d5507d674f8c07babbeb709645c92e892f
MD5 17c49bfb5ff46f5002528da0fbeaf3c2
BLAKE2b-256 456b805e03085a371953f72d5ac89b9fe972954f34e5a45378f8dc147403c893

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_pool-1.0.0-py3-none-any.whl:

Publisher: release.yml on MathiasPaulenko/behave-pool

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