A pytest plugin to collect and output test markers to JSON
Project description
pytest-collect-markers
A pytest plugin that collects test markers and outputs them to a JSON file.
Installation
pip install pytest-collect-markers
Usage
Run pytest with the --collect-markers flag to collect all markers from your tests:
pytest --collect-markers
This will create a markers.json file containing a mapping of test node IDs to their markers.
Options
| Option | Default | Description |
|---|---|---|
--collect-markers |
False |
Enable marker collection |
--markers-output |
markers.json |
Output file path for collected markers |
Example
pytest --collect-markers --markers-output=my-markers.json
Output Format
The output JSON file maps test node IDs to their list of markers:
{
"tests/test_example.py::test_slow_operation": ["slow", "integration"],
"tests/test_example.py::test_fast_unit": ["unit"]
}
Development
# Install with uv
uv sync
# Run tests
uv run pytest
License
MIT
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_collect_markers-0.2.0.tar.gz.
File metadata
- Download URL: pytest_collect_markers-0.2.0.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e945c78136054cca8d1eb92902bf82963fbc36991df48d59ab3240b781ef487
|
|
| MD5 |
16aecffd92a6b31954c510c42bee918e
|
|
| BLAKE2b-256 |
c776e5d616143ee568357f68c4c86669375afbff927469505ac53e3ce4dd1c7e
|
Provenance
The following attestation bundles were made for pytest_collect_markers-0.2.0.tar.gz:
Publisher:
CI.yml on suo/pytest-collect-markers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_collect_markers-0.2.0.tar.gz -
Subject digest:
4e945c78136054cca8d1eb92902bf82963fbc36991df48d59ab3240b781ef487 - Sigstore transparency entry: 850149935
- Sigstore integration time:
-
Permalink:
suo/pytest-collect-markers@b366c313877a330e59a93bda4f290f6efdbd0c5a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/suo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@b366c313877a330e59a93bda4f290f6efdbd0c5a -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_collect_markers-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pytest_collect_markers-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68789261ae7861c228961145ddd23a65843e66a80ba5a110fde13012781ab18e
|
|
| MD5 |
877c847bc8caa3243884f62c8889e1bd
|
|
| BLAKE2b-256 |
3d0a5d91ff6221e7f8c69ef1670335f48dc3b02610ce655222d28fd4b149bd05
|
Provenance
The following attestation bundles were made for pytest_collect_markers-0.2.0-py3-none-any.whl:
Publisher:
CI.yml on suo/pytest-collect-markers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_collect_markers-0.2.0-py3-none-any.whl -
Subject digest:
68789261ae7861c228961145ddd23a65843e66a80ba5a110fde13012781ab18e - Sigstore transparency entry: 850149936
- Sigstore integration time:
-
Permalink:
suo/pytest-collect-markers@b366c313877a330e59a93bda4f290f6efdbd0c5a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/suo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@b366c313877a330e59a93bda4f290f6efdbd0c5a -
Trigger Event:
push
-
Statement type: