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.2.tar.gz (57.1 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.2-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_item_dict-1.3.2.tar.gz
  • Upload date:
  • Size: 57.1 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.2.tar.gz
Algorithm Hash digest
SHA256 d69db7b565bdd8b3b189415f3502bf3f8f0d7a0e3b5f3b43fb036ddb8fdacab1
MD5 23ed5b55ba45aab59f8e6aac81decde2
BLAKE2b-256 63e74bcc52ce49351e18f515c8c7104f86df6188274bace97167701da6220266

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_item_dict-1.3.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_item_dict-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c954d0a3e7000d0f43af4e7184e805a7137c426704c1167889c611889cfdacc
MD5 cb3dbeb0d1cf1c65c3c7fb29098bf39b
BLAKE2b-256 85b35af498b86e1176ec4e9dd48c892687340984d257aa7e440dd12a05c4dc60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_item_dict-1.3.2-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