Freedom251 › BDD Testing Tools
Lettuce

What Lettuce is
Lettuce is free behavior-driven development software for Python projects. It runs plain-text functional descriptions as automated tests, allowing features to be written as natural-language scenarios while steps execute Python code. This gives non-programmers a way to describe expected behavior and developers a way to connect those descriptions to runnable tests. Lettuce runs locally from a shell and can execute complete feature files or selected scenarios. It is based on Cucumber and supports Gherkin, although its documentation says Lettuce has fewer features and concentrates on common BDD tasks. Step definitions can use the @step decorator with a sentence pattern, or derive wording from a function name or docstring. Steps can also be grouped in a class marked with @steps. Lettuce searches recursively for Python files in the features directory, supports Django hooks and built-in steps, and can emit Subunit results for continuous integration. Hooks run before and after features, scenarios, and steps. Linux and Windows are supported, under the GNU GPL version 3 or later.
Who it suits
Lettuce suits Python developers using local, plain-language BDD tests, including Django projects. It can also help non-programmers describe system behavior in scenarios.
What it does well
- Free under GPLv3 or later
- Plain-language scenarios with Python steps
- Gherkin and Cucumber-inspired workflow
- Django hooks and built-in steps
- Subunit output for CI
What to know first
- Fewer features than Cucumber
- Some documented features are unstable
- Runs locally from a shell
- Requires Python installation
Verdict
Lettuce links natural-language behavior descriptions to executable Python tests. It offers local BDD tooling with Django support, hooks, scenario selection, and continuous-integration output, while documenting a smaller feature set than Cucumber.
Facts from Lettuce's own pages
- Audience
- The tutorial says Lettuce lets people who do not program describe the behavior of a system in plain text. · lettuce.readthedocs.io, 8 Oct 2026
- CI output
- Lettuce can use Subunit to output test results for continuous-integration workflows. · lettuce.readthedocs.io, 8 Oct 2026
- Command-line use
- Lettuce runs from a shell and can run feature files or selected scenarios. · lettuce.readthedocs.io, 8 Oct 2026
- Cucumber inspiration
- The documentation describes Lettuce as a BDD tool based on Cucumber, which has more features than Lettuce. · lettuce.readthedocs.io, 8 Oct 2026
- Django
- The project README lists Django among the packages used in Lettuce's tests. · github.com, 8 Oct 2026
- Django integration
- Lettuce supports Django projects and documents Django-specific hooks and built-in steps. · lettuce.readthedocs.io, 8 Oct 2026
- Founded
- 2010 · lettuce.readthedocs.io, 28 Sept 2026
- Grouped steps
- Lettuce supports grouping steps in a class decorated with @steps. · lettuce.readthedocs.io, 8 Oct 2026
- Installation
- The tutorial instructs users to install Lettuce from a terminal with pip after installing Python. · lettuce.readthedocs.io, 8 Oct 2026
- Known comparison
- The documentation says Lettuce focuses on common BDD tasks and has fewer features than Cucumber. · lettuce.readthedocs.io, 8 Oct 2026
- License
- The repository identifies Lettuce as free software under the GNU General Public License version 3 or later. · github.com, 8 Oct 2026
- Natural-language scenarios
- Developers can describe features in natural language as scenarios and define Python steps that execute them. · lettuce.readthedocs.io, 8 Oct 2026
- Purpose
- Lettuce runs plain-text functional descriptions as automated tests for Python projects using behavior-driven development. · lettuce.readthedocs.io, 8 Oct 2026
- Scenario writing
- Features can be described in natural language as one or more scenarios, with steps that run Python code. · lettuce.readthedocs.io, 8 Oct 2026
- Step discovery
- Lettuce recursively looks for Python files inside the features directory; the files can have any name ending in .py. · lettuce.readthedocs.io, 8 Oct 2026
- Step syntax
- Steps can be defined with the @step decorator, using a sentence pattern or taking the sentence from a function name or docstring. · lettuce.readthedocs.io, 8 Oct 2026
- Support
- The project documentation directs users to an issue tracker and user and development mailing lists. · lettuce.readthedocs.io, 8 Oct 2026
- Test setup hooks
- Hooks can run before and after features, scenarios, and steps for tasks such as setting up or cleaning test data. · lettuce.readthedocs.io, 8 Oct 2026
- Unstable features
- The documentation warns that step.behave_as and xUnit XML output are unstable and untested. · lettuce.readthedocs.io, 8 Oct 2026
- Windows support
- The project README notes that a contributor made Lettuce work on Windows and points to an installation guide. · github.com, 8 Oct 2026
Where Lettuce stands on Freedom251
- BDD Testing Tools#23 of 30