pytest-bdd
pytest-bdd.readthedocs.io
What it is
pytest-bdd is a Python package for automating requirements tests with behavior-driven development. It implements a subset of Gherkin and runs scenarios as pytest tests, without a separate test runner. Feature steps can reuse pytest fixtures through dependency injection, and step definitions can accept arguments parsed as strings, with parse or cfparse formats, or by regular expression. The scenarios helper can bind scenarios from feature files and folders, including recursive folder discovery. Scenario outlines support parameterized cases and tagged example tables; step functions can also receive Gherkin data tables as row lists and docstrings as strings. For browser tests, the documented example uses pytest-splinter to provide a browser fixture. Installation is via `pip install pytest-bdd`. The package is open source under the MIT License, free at free, and requires Python 3.10 or newer. Listed platforms are Linux, macOS, and Windows.
Spec sheet
- Purpose
- pytest-bdd implements a subset of Gherkin to automate requirements testing and support behavior-driven development.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- License
- PyPI lists the package as licensed under the MIT License.Read 8 Oct 2026 · pypi.org
- Browser integration
- The documentation’s browser test example uses pytest-splinter to provide a browser fixture.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Fixture reuse
- Pytest fixtures can be reused in feature steps through dependency injection.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Gherkin data
- Step functions can receive Gherkin data tables as lists of rows and step docstrings as strings.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Installation
- The documentation gives `pip install pytest-bdd` as the installation command.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Pytest integration
- It runs scenarios as pytest tests without requiring a separate test runner.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Python requirement
- The package metadata requires Python 3.10 or newer.Read 8 Oct 2026 · pypi.org
- Release
- PyPI lists version 9.0.0, released September 30, 2026.Read 8 Oct 2026 · pypi.org
- Scenario discovery
- The scenarios helper can bind scenarios found in feature files or folders, including recursively discovered files in a folder.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Scenario outlines
- Scenario outlines support parameterized cases, and the documentation describes multiple tagged example tables.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Step arguments
- Step definitions can use string, parse, cfparse, or regular-expression parsers for step arguments.Read 8 Oct 2026 · pytest-bdd.readthedocs.io
- Supported operating systems
- PyPI classifiers list macOS, Windows, and POSIX operating systems.Read 8 Oct 2026 · pypi.org
Plans and prices
Strong points and limits
Strong points
- Runs scenarios as pytest tests.
- Reuses pytest fixtures in feature steps.
- Supports several step-argument parsers.
- Scenario outlines support parameterized cases.
- Free, MIT-licensed package.
Limits
- Requires Python 3.10 or newer.
- Implements only a subset of Gherkin.
Who it suits
It suits Python teams using pytest for behavior-driven requirements testing, especially those that want to reuse fixtures in feature steps. Browser testing is also covered through a pytest-splinter example.
Verdict
pytest-bdd brings Gherkin-style scenarios into pytest and supports fixture reuse, parameterized outlines, and several ways to parse step arguments. Its stated limits include a subset of Gherkin and a Python 3.10 minimum.
Where Specifiction places it
- BDD Testing Tools#19 of 307.4