Skip to main content

Get a hierarchical dict of session.items

Project description

PyPI version Python versions See Build Status on GitHub Actions

Get a hierarchical dict of session.items Used code from pytest-collect-formatter


This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.

Features

  • Builds a hierarchical dict mirroring the pytest collection tree (directory → module → class → test function) from session.items

  • Provides two live dicts:

    • collect_dict — pure structure populated after collection, with optional marker annotations

    • test_dict — populated incrementally during the run; records outcomes, durations, markers, and aggregated @counts

  • Every parent node automatically receives a @counts dict that sums the outcomes of all leaf tests beneath it (passed, failed, skipped, unexecuted, executed, total) and a @total_duration float

  • Configurable via pytest.ini / pyproject.toml options:

    • create_item_dict — enable/disable the plugin entirely (default: true)

    • set_collect_dict_markers — annotate collect_dict nodes with marker names (default: false)

    • set_test_dict_markers — annotate test_dict nodes with marker names (default: false)

    • set_test_dict_outcomes — record @outcome on each test node (default: true)

    • set_test_dict_durations — record @duration per test and @total_duration on parent nodes (default: false)

    • update_dict_on_test — update test_dict after every individual test in real-time (default: true)

    • set_test_dict_setup_teardown — record setup/teardown phase outcomes as separate nodes in test_dict (default: false)

  • Self-registers via the pytest11 entry point — no conftest.py changes required for basic use

  • Dicts are accessible from any hook via the plugin manager

Requirements

  • Python >= 3.11

  • pytest >= 8.3.0

Installation

You can install “pytest-item-dict” via pip from PyPI:

$ pip install pytest-item-dict

Usage

  • TODO

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Dual License:

Distributed under the terms of both the BSD-3 AND Mozilla Public License 2.0 licenses.

“pytest-item-dict” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_item_dict-1.3.0.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_item_dict-1.3.0-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest_item_dict-1.3.0.tar.gz.

File metadata

  • Download URL: pytest_item_dict-1.3.0.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pytest_item_dict-1.3.0.tar.gz
Algorithm Hash digest
SHA256 c8099276dbd184dfab6f394297e6eb4f8eb47609764d5b66b3004d365535af04
MD5 41ba88bd3d39ed675c498a52ad8d4136
BLAKE2b-256 f21a830ca821d43a4028b08730e2ddf435c653d3231ae1cce9356a4913fe99a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_item_dict-1.3.0.tar.gz:

Publisher: publish-to-test-pypi.yml on anogowski/pytest-item-dict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_item_dict-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_item_dict-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fefa2385413466fd6c8100aecf6fac2b3ca94842c6153a0751d836c02ae7d28d
MD5 cc62d7056cab314b08ee20d80c7cf6e8
BLAKE2b-256 83ebb629c50287d9dd7835d40aa0b637a7ba13f62f5bf9b6b8ce0beb42a0c8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_item_dict-1.3.0-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on anogowski/pytest-item-dict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page