Installation

From PyPI

pip install behave-retry

For development

git clone https://github.com/MathiasPaulenko/behave-retry.git
cd behave-retry
pip install -e ".[dev]"

This installs behave-retry in editable mode along with development tools:

  • pytest + pytest-cov — testing and coverage

  • ruff — linting and formatting

  • behave — for running integration tests

For documentation

pip install -e ".[docs]"

This installs Sphinx, Furo theme, and MyST parser for building the docs locally:

python -m sphinx -b html docs/ docs/_build/html

Then open docs/_build/html/index.html in your browser.

Requirements

  • Python 3.11+

  • Zero runtime dependenciesbehave is only needed as a dev dependency for running tests

Verify installation

import behave_retry
print(behave_retry.__version__)

Troubleshooting

ImportError: No module named behave

behave is not a runtime dependency of behave-retry. Install it separately:

pip install behave

setup_retry has no effect

Make sure you’re calling setup_retry in before_all, not in before_scenario. The patch must be applied before any scenario runs.

Retry not triggering for tagged scenarios

Check that your retry_tags configuration matches the tags on your scenarios. Behave strips the leading @ from tags, but behave-retry accepts both @flaky and flaky in retry_tags.

# These are equivalent:
setup_retry(context, retry_tags=["@flaky"])
setup_retry(context, retry_tags=["flaky"])

py.typed not found

If your type checker doesn’t recognize behave-retry types, ensure you’re using version 1.8.0+ which includes the py.typed marker. Upgrade with:

pip install --upgrade behave-retry