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.1.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.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest_collect_markers-0.1.0.tar.gz.

File metadata

  • Download URL: pytest_collect_markers-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 b453c48ba95e8f8bf333f9270e82424a6fa333a4c25c9983bcca1eb668655cb0
MD5 d629426dac09f0dff5f88a54d1a00042
BLAKE2b-256 ec394b031f1192240c25c012f04666dbd4249662dd6644551ff859545b8089e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_collect_markers-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_collect_markers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7933bbf76fb808a59cea0f9d7d6ae83280a9c72271e9211b90559218dad6dea0
MD5 5f2db17b36e479fb38704514762a1787
BLAKE2b-256 bda68ff4c63f23b1c7bcef746b787697c9423f6f457f889beaee5b27e4fbf58c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_collect_markers-0.1.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