TDD in Python with pytest workshop with Leonardo Giordani


Details
Reminder: as usual everyone will end up on a waitlist queue, we will be moving people to RSVP manually. If you can't attend the meetup, please be respectful and free up your space. Thanks :)
----------------------
The rough capacity is 20 people.
----------------------
# Abstract
Test-Driven Development is a methodology that can greatly improve the quality of your software. I strongly believe that developing software without following as much as possible a test-driven approach leads to massive delays and greater issues when requirements change (always, that is).
In this workshop we will develop a very simple Python project following TDD with the help of the pytest framework. We will work together, and no previous knowledge of testing or the testing framework is required. A minimum knowledge of Python is required, but the project will be very simple, so that we can focus on learning the testing methodology.
The workshop lasts for 3 hours.
# About Leonardo Giordani @tw_lgiordani
Software Engineer and Open Source Contributor. I am currently working at WeGotPOP, a London-based company that creates software for film casting agencies. We work with Python and Javascript, Docker, AWS, React.
From 2013 I blog some technical thoughts at http://thedigitalcatonline.com
# Schedule
- Introduction to testing and TDD (30 mins)
- Hands-on development of a simple Python project (1h30): pytest command line, unit tests, how to deal with bugs and new features, exceptions, fixtures, coverage.
- Introduction to mocks (20 mins)
- Hands-on development of simple mocks for the project (20 mins)
- Recap (10 mins)
# Software requirements
You need to have a laptop with Python 3 or Python 2 installed and your editor of choice.
You also need to install at least the pytest framework (https://docs.pytest.org/en/latest/).
On Leonardo's GitHub account you can find a cookiecutter package that prepares an empty Python project with pytest and other tools already installed and configured. To use it follow this instructions
``` sh
python3 -m venv venv3
source venv3/bin/activate
pip install cookiecutter
cookiecutter https://github.com/lgiordani/cookiecutter-pypackage
```
This will ask some details on the project. Answer with the following values
project_name: pytest_workshop
project_slug: pytest_workshop pypi_username: version: 0.1.0
use_pytest: y
use_pypi_deployment_with_travis: n Select command_line_interface: 2 (no-command-line interface)
create_author_file: y
Select open_source_license: 1 (MIT)
Then go on with
``` sh
cd pytest_workshop
pip install -r requirements/dev.txt
```
Once this is done you should be able to run
``` sh
pytest -svv
```
and get a nice report that informs you that 1 test is passed.
Before the beginning of the workshop there will be some time to try to sort out any outstanding issues, but please try as much as possible to arrive with a working setup. If you need help you can reach me out on Twitter @tw_lgiordani :)

Sponsors
TDD in Python with pytest workshop with Leonardo Giordani