#8079·pytest

Breakdown of setup duration

Author: gaborbernatCreated Nov 27, 2020Updated Sep 24, 2026
Labelstype: proposaltopic: reportingtopic: fixtures

At the moment, pytest aggregates together setup duration per test and displays it within the duration. This means if a setup is slow, you can identify it. However, if a setup is composed of multiple fixtures, there's no easy way to discern how much each of those fixtures took. Would be nice to have this information is shown, something like:

bash
15.66s setup    tests/test_provision.py::test_provision_requires_ok(fixture_a[5]+fixture_b[3]+fixture_c[7]s)

If the setup contains a single fixture, we can omit this part and not show fixtures whose time is less than 0.1.