behave
behave is behaviour-driven development, Python style
What it is and what it does
behave is a Python implementation of behavior-driven development that bridges the gap between business requirements and test automation. It uses Gherkin—a plain-English syntax for writing test scenarios—paired with Python step implementations to create executable specifications that both technical and non-technical stakeholders can understand and collaborate on.
The framework reads .feature files containing human-readable scenarios (Given-When-Then format), maps each step to Python functions you write, and executes them as tests. It's designed for acceptance testing and cross-team communication rather than unit testing, making it useful when you need to document and validate business behavior in a format that bridges development and QA.
Use it for:
- Write acceptance tests in plain English that product managers and QA can read and verify without reading Python code.
- Document system behavior as executable specifications that stay in sync with actual functionality.
- Automate end-to-end workflows where each step represents a user action or system state change.
- Enable non-technical stakeholders to contribute test scenarios by writing Gherkin without touching Python.
- Build a shared test suite that developers, QA, and business analysts can collaborate on and maintain together.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
behave is a behavior-driven development (BDD) framework that lets you write test scenarios in plain Gherkin language, backed by Python step implementations, to enable collaboration between developers, QA, and business stakeholders.
Yes. behave is actively maintained, has no known vulnerabilities, carries permissive licensing, and low install friction. It's a mature choice (Production/Stable status since 2011) for teams that want BDD-style acceptance testing with readable, collaborative test scenarios. Install it if your workflow involves non-technical stakeholders in test design or if you want executable specifications written in natural language.
Install
behave on PyPI
pip
pip install behaveuv
uv add behavepoetry
poetry add behaveInstalling behave
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with recent commits and carries 15 runtime dependencies including parsing libraries (parse, parse-type, cucumber-expressions) and compatibility shims (six, pathlib2, enum34) to support older Python versions.
License in practice
Licensed under BSD-2-Clause (permissive), which allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install behave
# Create features/example.feature with Gherkin scenarios
# Create features/steps/example_steps.py with step implementations
from behave import given, when, then
@given('a precondition')
def step_impl(context):
pass
# Run: behave
Requires a features/ directory structure with .feature files (Gherkin syntax) and a steps/ subdirectory containing Python step definitions to function.
Verify before relying
- Whether the 15 runtime dependencies (including older Python compatibility shims like enum34, pathlib2) are all actively maintained or if some are legacy holdovers.
- Performance characteristics or scalability limits when running large numbers of scenarios or steps.
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 15 — cucumber-tag-expressions, cucumber-expressions, enum34, parse, parse-type, six, contextlib2, pathlib, pathlib2, scandir, traceback2, win_unicode_console, colorama, tomli, toml |
| Maintenance | actively maintained — 344 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,950,549/month — #2,004 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: behave-1.3.3-py2.py3-none-any.whl
Keywords: BDD, behavior-driven-development, bdd-framework, behave, gherkin, cucumber-like
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
behave-djangoIntegrates Behave BDD testing into Django…
permissive · top 15,000 on PyPI
behavexBehaveX extends Behave with parallel test…
unclear · top 15,000 on PyPI
pytest-bddpytest-bdd implements Gherkin-based…
permissive · top 5,000 on PyPI
radish-bddradish is a Behavior Driven Development (BDD)…
permissive · top 15,000 on PyPI
cucumber-tag-expressionsParses and evaluates boolean tag expressions…
permissive · top 5,000 on PyPI
cucumber-expressionsCucumber Expressions provides a simpler, more…
permissive · top 5,000 on PyPI
terraform-complianceterraform-compliance is a BDD-based test…
permissive · top 15,000 on PyPI
vedroVedro is a scenario-style testing framework for…
permissive · top 15,000 on PyPI
behave-html-formatterGenerates HTML reports from Behave BDD test…
copyleft · top 15,000 on PyPI
gherkin-officialParses and compiles Gherkin feature files into…
permissive · top 5,000 on PyPI