skillfed

behave

behave is behaviour-driven development, Python style

behave v1.3.3 6.0M downloads/30d#2,004 on PyPI3,523
Permissive license BSD-2-Clause Active released

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 behave

uv

uv add behave

poetry

poetry add behave

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Tags

BDD testing frameworkGherkin test scenariosbehavior-driven development Pythoncucumber-like testingnatural language test automationacceptance testing frameworkfeature file testing
bddacceptance-testinggherkin

More Testing packages