pytest-multi-backend

Run one pytest suite against several interchangeable backends

$ pip install pytest-multi-backend

This requires Python 3.12+.

A “backend” is one way of running the system which the tests exercise. A suite might run against a real remote service, an in-memory fake of that service, and the same fake behind an HTTP server, and assert the same things about each. That is how a fake is kept honest.

See Usage for how to make a fixture which runs each test once per backend, and API Reference for the details.

Reference