Registry / testing / radish-bdd

radish-bdd

JSON →
library0.18.4pypypi✓ verified 87d ago

radish is a Behavior Driven Development tool completely written in Python. It supports all Gherkin language features and also implements unconventional BDD features such as Scenario Preconditions, Scenario Loops, Constants, and Expressions. The library is actively maintained, with the latest stable version 0.18.4 released on February 24, 2026.

pip install radish-bdd
INSTALL
IMPORT
SIG · RADISH-BDD
R
radish-bdd
testingpythonv0.18.4
Install
3.2s avg
Import
136ms
Disk
22MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.18.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.147s · 23.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.2s · import 0.125s · 24MB
22MB installed
● package 22MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

given, when, then
from radish import given, when, then
These decorators are used to define step implementations in your Python files.
before, after
from radish import before, after
These decorators are used to define hooks that run before or after features, scenarios, or steps.
world
from radish import world
The 'world' object provides global context for configuration and utility functions. For scenario-specific data, use `scenario.context` instead of `world` to avoid state leakage.
main
from radish import main
Used for programmatic execution of radish tests, typically for integration with other tools.

To get started with radish, you typically create a `.feature` file written in Gherkin syntax and a corresponding Python file (e.g., `radish/steps.py`) with step implementations. Then, you execute `radish` from your terminal, pointing to the feature file.

# 1. Create a feature file (e.g., calculator.feature): # Feature: Simple Calculator # In order to avoid silly mistakes # As a math enthusiast # I want to be able to add numbers # # Scenario: Add two numbers # Given I have the number 5 # And I have the number 7 # When I add them # Then the result should be 12 # 2. Create a step implementation file (e.g., radish/steps.py): from radish import given, when, then, world @given("I have the number {number:g}") def have_number(step, number): if not hasattr(world, 'numbers'): world.numbers = [] world.numbers.append(number) @when("I add them") def add_numbers(step): world.result = sum(world.numbers) @then("the result should be {expected_result:g}") def check_result(step, expected_result): assert world.result == expected_result # 3. Run from your terminal in the directory containing 'calculator.feature': # radish calculator.feature
radish --version
Debug
Known issues
breakingradish-bdd officially dropped support for Python 2 in recent versions (specifically 0.18.0+). Projects migrating from very old radish versions must upgrade to Python 3.
fix
Ensure your project is running on Python 3.x. Update your environment and code if necessary.
affects: <0.18.0
gotchaThe `world` object provides a global context, but it is not intended for storing scenario-specific data. Using `world` for this purpose can lead to test interference and state leakage between scenarios.
fix
For data specific to a scenario, use `scenario.context`. Example: `scenario.context.my_data = 'value'` instead of `world.my_data = 'value'`.
affects: All
gotchaIf a Gherkin step in your feature file does not have a corresponding Python step implementation, radish will raise an exception and stop the test run.
fix
Ensure all steps in your feature files have a matching Python function decorated with `@given`, `@when`, or `@then`. Use the `--dry-run` (`-d`) option to identify unimplemented steps without actually executing them.
affects: All
Errors
Common errors & fixes
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
This error or similar `lxml` related errors (e.g., `cannot find -lz`) often indicate missing C libraries like libxml2, libxslt1-dev, or zlib1g-dev required by `lxml`, which radish-bdd uses for XML reporting. This was a known issue, especially on Linux and older Windows installations.
fix
On Debian/Ubuntu: `sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev`. On other Linux distributions, use the equivalent package manager. For Windows, ensure all C++ build tools are installed or try updating `pip` and `lxml` itself: `pip install --upgrade pip lxml`.
radish.exceptions.RadishError: No step implementation found for step 'Given I have an unimplemented step'
A step defined in your `.feature` file does not have a matching Python function decorated with `@given`, `@when`, or `@then` in your step definition files.
fix
Implement the missing step function in your `radish/steps.py` (or other step definition files). For example, for 'Given I have an unimplemented step', add `@given("I have an unimplemented step")\ndef have_unimplemented_step(step):\n    pass`.
Upgrade
Version history
0.18.4latest on PyPI · released Feb 24, 2026
Audit
Dependencies
Pythonrequiredradish-bdd requires Python 3. Older versions supported Python 2, but this is no longer the case.
Agent activity
15 hits · last 30 days
node
12
Amazon
1
Resources
radish-bdd — pip install radish-bdd · libregistry