collect-unmarked-tests-0.1.0 is not a library.
Collect unmarked pytest
A fast Rust tool to collect Python tests that don't have specific pytest markers.
Usage
# Scan default 'tests' directory
# Scan specific directory
# Exclude specific markers
Build
Prerequisites:
- Rust toolchain (stable). Install via https://rustup.rs
Debug build:
Release build:
Install locally (optional):
The last command is equivalent to:
Default excluded markers
unitintegrationcomponentskipslow
The tool scans Python files for test_* functions and excludes those with
pytest markers like @pytest.mark.unit or @skip.
Exit codes
- 0: No unmarked tests found
- 1: Unmarked tests found (for CI/CD integration)
Using as a pre-commit hook
Add this to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/stancld/collect-unmarked-tests
rev: v0.1.0 # Use a specific version tag
hooks:
- id: collect-unmarked-tests
args:
To scan only specific directories/packages:
repos:
- repo: https://github.com/stancld/collect-unmarked-tests
rev: v0.1.0
hooks:
- id: collect-unmarked-tests
args:
Or use a local installation:
repos:
- repo: local
hooks:
- id: collect-unmarked-tests
name: Check for unmarked pytest tests
entry: collect-unmarked-tests
language: system
files: '\.py$'
args:
pass_filenames: false