CheckOps home

Tools directory

B

CheckOps

behave

behave is a BSD-licensed behaviour-driven development framework for Python that runs Gherkin feature files with step definitions written in Python.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

behave describes itself as “BDD, Python style”. Behaviour-driven development uses plain-language scenarios, written in Gherkin with Given/When/Then steps, as shared specifications between product, QA and engineering. behave reads .feature files and matches each step to a Python function decorated with @given, @when or @then.

Projects follow a convention: a features/ directory holding feature files, a steps/ subdirectory for step implementations, and an optional environment.py for hooks such as before_all, before_scenario and after_step, often used to start browsers or reset databases. Step patterns can use the parse library’s syntax ({count:d}) or regular expressions, and scenarios support outlines with example tables, backgrounds, tags for selection (--tags=@smoke) and multiple formatters, including pretty, plain, JSON and JUnit XML for CI. The latest release, v1.3.3, was published on 4 September 2025, and the repository remains active with commits in November 2026.

The source code is at behave/behave on GitHub under the BSD-2-Clause licence, with about 3,500 stars; the most recent commit was on 6 November 2026.

Features

  1. Gherkin scenarios: Readable specifications shared with non-developers.
  2. Python step definitions: Decorated functions with parse or regex patterns.
  3. Hooks: Environment hooks for setup and teardown.
  4. Tags and formatters: Select scenarios and output JUnit XML or JSON.

Pros

  1. Free to use: Open source under the BSD-2-Clause licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 6 November 2026.
  3. Community: About 3,500 GitHub stars.

Cons

  1. Separate from pytest: Does not use pytest fixtures; pytest-bdd integrates with pytest instead.
  2. BDD overhead: Gherkin adds value only when stakeholders read the scenarios.
# features/cart.feature
Feature: Cart
  Scenario: Add an item
    Given an empty cart
    When I add 2 apples
    Then the cart contains 2 items
# features/steps/cart_steps.py
from behave import given, when, then

@given("an empty cart")
def step_empty(context):
    context.cart = []

@when("I add {count:d} apples")
def step_add(context, count):
    context.cart += ["apple"] * count

@then("the cart contains {count:d} items")
def step_check(context, count):
    assert len(context.cart) == count
pip install behave
behave --tags=@smoke --junit

Resources:

Pricing

behave is free and open source under the BSD-2-Clause licence.

  1. Teams practising BDD in Python with business-readable scenarios.
  2. QA teams writing acceptance tests outside pytest.

Conclusion

behave is the classic Python BDD framework, straightforward and well documented, ideal when Gherkin scenarios are a genuine collaboration tool.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with behave side by side.