Skip to main content

Details

pytest-fixture-report is a pytest plugin aimed at assisting debugging slow tests. While pytest provides --durations=N, this does not always provide enough granularity to find problem areas, where they exist in test setup i.e. slow fixtures.

This plugin aims to fill that gap.

Reports

Provider reports are:

  • spent: Summary of total time spent in fixtures.
  • cumul: Breakdown of N slowest fixtures by cumulative time.
  • avg: Breakdown of N slowest fixtures by average time.
  • most: Breakdown of N most called fixtures.

This assists in detecting fixtures that are very slow, but not called very often (top of cumul, but not avg/most), and fixtures that aren't very slow, but are called too often (top of most, but not of avg).

Reports are all enabled by default, capturing N=25.

These can be configured using various flags:

  • --fixture-report: Enable to report.
  • --fr-slowest=N: Number of fixtures to report on in cumul, avg reports.
  • --fr-most=N: Number of fixtures to report on in most report.
  • --fr-reports: Comma separated list of reports to enable.

Output

===================================== Time spent in fixtures 17.66s =====================================
=================================== Slowest 10 fixtures (cumulative) ====================================
account                                         8.86s
pogo_engine                                     2.26s
_trade_data                                     1.29s
channel                                         0.65s
db_session                                      0.62s
web_client                                      0.49s
basic_monthly                                   0.45s
user                                            0.45s
_patch_pg_pool                                  0.45s
app                                             0.39s
===================================== Slowest 10 fixtures (average) =====================================
pogo_engine                                     2.26s
app                                             0.39s
_trade_data                                     0.22s
postgres_dsn                                    0.09s
account                                         0.08s
db_connection                                   0.05s
pg_conn                                         0.02s
user                                            0.00s
everflow_config                                 0.00s
config                                          0.00s
======================================== Most called 5 fixtures =========================================
db_session                                      2397
monkeypatch                                     1458
city                                            1352
subscription_factory                            1343
basic_monthly                                   1340

Release files for pytest-fixture-report 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-fixture-report 0.1.0
File Size Uploaded
pytest_fixture_report-0.1.0.tar.gz 39.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-fixture-report 0.1.0
File Interpreter ABI Platform
pytest_fixture_report-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.9 kB

Release files / pytest_fixture_report-0.1.0.tar.gz

Download URL pytest_fixture_report-0.1.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7570a2a0553bff1f4700f68fd2d953d53c6f7b53a942676ead59d3fc08967a16
BLAKE2b-256 checksum
How to use checksums
fd4fd63e28336fba1516ac26d6c31895c5983c89963dc98c2cf911ebfd986d89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / pytest_fixture_report-0.1.0-py3-none-any.whl

Download URL pytest_fixture_report-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a8e02d04d713fdf1d728ba1113ac3b51be43e7495728767525f0bdc46bf3a79
BLAKE2b-256 checksum
How to use checksums
9b2893b428c39e98ed3d3222f1ae0ee71b50c543a8dc4f69dd6d260e13e23bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page