- Home
- BDD Testing Tools
- pytest-bdd
pytest-bdd
What it is
pytest-bdd is a free, open-source Python package for automating requirements tests with behavior-driven development. It implements a subset of Gherkin and runs scenarios as pytest tests, so projects do not need a separate test runner. Pytest fixtures can be reused in feature steps through dependency injection. Step definitions support string, parse, cfparse, and regular-expression parsers for arguments. The scenarios helper binds scenarios from feature files or folders, including recursively discovered files. Scenario outlines support parameterized cases and multiple tagged example tables. Step functions can receive Gherkin data tables as row lists and docstrings as strings. The documented browser example uses pytest-splinter to provide a browser fixture. Installation uses `pip install pytest-bdd`. The package requires Python 3.10 or newer, lists Linux, macOS, and Windows support, and is licensed under MIT. PyPI lists version 9.0.0, released September 30, 2026.
For and against
For
- Runs scenarios as pytest tests
- Reusable fixtures through dependency injection
- Multiple step-argument parsers
- Parameterized scenario outlines
- Browser fixture example available
Against
- Requires Python 3.10 or newer
- Implements only a subset of Gherkin
- Browser example depends on pytest-splinter
- Runs locally rather than as a hosted service
The verdict
pytest-bdd adds Gherkin-style behavior scenarios to pytest without a separate runner. Its fixture, parser, parameterization, and browser options support varied Python testing workflows.
Who it suits
pytest-bdd suits Python teams using pytest and Gherkin-style scenarios for requirements testing. It is useful when projects need fixture reuse, parameterized scenarios, or browser-test integration.
Plans and prices
pytest-bdd
MIT-licensed Python package · requires Python 3.10 or newer
Read 8 Oct 2026 · pypi.org
On the record
- Browser integration
- The documentation’s browser test example uses pytest-splinter to provide a browser fixture.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Fixture reuse
- Pytest fixtures can be reused in feature steps through dependency injection.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Gherkin data
- Step functions can receive Gherkin data tables as lists of rows and step docstrings as strings.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Installation
- The documentation gives `pip install pytest-bdd` as the installation command.pytest-bdd.readthedocs.io · read 8 Oct 2026
- License
- PyPI lists the package as licensed under the MIT License.pypi.org · read 8 Oct 2026
- Purpose
- pytest-bdd implements a subset of Gherkin to automate requirements testing and support behavior-driven development.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Pytest integration
- It runs scenarios as pytest tests without requiring a separate test runner.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Python requirement
- The package metadata requires Python 3.10 or newer.pypi.org · read 8 Oct 2026
- Release
- PyPI lists version 9.0.0, released September 30, 2026.pypi.org · read 8 Oct 2026
- Scenario discovery
- The scenarios helper can bind scenarios found in feature files or folders, including recursively discovered files in a folder.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Scenario outlines
- Scenario outlines support parameterized cases, and the documentation describes multiple tagged example tables.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Step arguments
- Step definitions can use string, parse, cfparse, or regular-expression parsers for step arguments.pytest-bdd.readthedocs.io · read 8 Oct 2026
- Supported operating systems
- PyPI classifiers list macOS, Windows, and POSIX operating systems.pypi.org · read 8 Oct 2026