Skip to main content

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


Download files

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

Source Distribution

pytest_collect_markers-0.2.0.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

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

pytest_collect_markers-0.2.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for pytest_collect_markers-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4e945c78136054cca8d1eb92902bf82963fbc36991df48d59ab3240b781ef487
MD5 16aecffd92a6b31954c510c42bee918e
BLAKE2b-256 c776e5d616143ee568357f68c4c86669375afbff927469505ac53e3ce4dd1c7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_collect_markers-0.2.0.tar.gz:

Publisher: CI.yml on suo/pytest-collect-markers

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_collect_markers-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_collect_markers-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68789261ae7861c228961145ddd23a65843e66a80ba5a110fde13012781ab18e
MD5 877c847bc8caa3243884f62c8889e1bd
BLAKE2b-256 3d0a5d91ff6221e7f8c69ef1670335f48dc3b02610ce655222d28fd4b149bd05

See more details on using hashes here.

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

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