Skip to content

pyladiesams/bdd-with-python-mar2025

Repository files navigation

BDD with Python

Workshop description

This workshop introduces Behavior-Driven Development (BDD) in Python using behave and pytest-bdd. BDD helps teams write tests that are easy to understand and closely aligned with business requirements by using Given-When-Then scenarios in plain language.

BDD bridges the gap between developers, testers, and stakeholders by encouraging collaboration, promoting clean, well-tested code, and making test cases more meaningful and maintainable.

Requirements

Usage

  1. Start by cloning the repo:
git clone <github-url-of-workshop-repo>
cd <name-of-repo>

Inside the repo folder, you can then create a virtual environment and install dependencies in your preferred way.

With UV

uv venv -p 3.8
uv lock # (optional)
uv sync --all-extras
source .venv/bin/activate # Or via IDE

With venv

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

You can test that the setup was successful by running

behave -q -o test.txt solutions/features 
rm test.txt 
Writing to text file instead of stdout to prevent spoilers.

If everything went well, you should see 3 features passed, 0 failed, 0 skipped, followed by more lines.

Video record

Re-watch this YouTube stream

Credits

This workshop was set up by @pyladiesams and @gCaglia.

About

An introduction to BDD and frameworks in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published