Get a hierarchical dict of session.items
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8099276dbd184dfab6f394297e6eb4f8eb47609764d5b66b3004d365535af04
|
|
| MD5 |
41ba88bd3d39ed675c498a52ad8d4136
|
|
| BLAKE2b-256 |
f21a830ca821d43a4028b08730e2ddf435c653d3231ae1cce9356a4913fe99a2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_item_dict-1.3.0.tar.gz -
Subject digest:
c8099276dbd184dfab6f394297e6eb4f8eb47609764d5b66b3004d365535af04 - Sigstore transparency entry: 1566548329
- Sigstore integration time:
-
Permalink:
anogowski/pytest-item-dict@01ab6273c6b7ba788708d31b36bad1b6a0e2635c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anogowski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@01ab6273c6b7ba788708d31b36bad1b6a0e2635c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_item_dict-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pytest_item_dict-1.3.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fefa2385413466fd6c8100aecf6fac2b3ca94842c6153a0751d836c02ae7d28d
|
|
| MD5 |
cc62d7056cab314b08ee20d80c7cf6e8
|
|
| BLAKE2b-256 |
83ebb629c50287d9dd7835d40aa0b637a7ba13f62f5bf9b6b8ce0beb42a0c8f3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_item_dict-1.3.0-py3-none-any.whl -
Subject digest:
fefa2385413466fd6c8100aecf6fac2b3ca94842c6153a0751d836c02ae7d28d - Sigstore transparency entry: 1566548335
- Sigstore integration time:
-
Permalink:
anogowski/pytest-item-dict@01ab6273c6b7ba788708d31b36bad1b6a0e2635c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anogowski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@01ab6273c6b7ba788708d31b36bad1b6a0e2635c -
Trigger Event:
push
-
Statement type: