Sharing is Caring - Sharing pytest Fixtures
03-19, 11:30–11:55 (US/Pacific), SFU Harbour Centre

pytest rocks, obviously. When people start using pytest as a team, they often come up with cool fixtures that would be great to share across projects. In fact, many great Python packages come pre-loaded with pytest fixtures. This talk describes how easy it is to share fixtures using the pytest plugin model.

There are a lot of people creating awesome pytest fixtures to help them with their testing.

In order to share those fixtures with others, we need to discuss Python packaging and pytest plugins.
Both of those topics, building plugins and packaging, have a bad rap due to their complexity in the past.
But things have gotten a ton better with packaging. And when you just want to share a fixture, you don't really need to know much about the pytest plugin system.

This talk walks through a small fixture example, then walks through how to make it into a plugin, and how to package it. It's a very gentle onramp to modern packaging.

The example will discuss show code exampes for setuptools, flit, and hatch, all using pyproject.toml

Host of "Python Bytes" and "Test & Code" podcasts.
Author of "Python Testing with pytest".
Software Engineer.