pytest-explicit
raw JSON → 1.0.1 verified Fri May 01 auth: no python
A Pytest plugin that allows tests to be marked as `@pytest.mark.explicit`, causing them to be skipped by default. Tests can be explicitly run by passing the `--explicit` flag. Version 1.0.1 is the latest and stable, with no new releases since 2021.
pip install pytest-explicit Common errors
error pytest: error: unrecognized arguments: --explicit ↓
cause pytest-explicit is not installed or not correctly installed in the current environment.
fix
Run
pip install pytest-explicit and verify with pip list | grep pytest-explicit. error AttributeError: module 'pytest' has no attribute 'mark' ↓
cause Using pytest.mark without importing pytest first, or running pytest incorrectly (e.g., with a different Python interpreter).
fix
Add
import pytest at the top of your test file. error Failed: Could not load plugin 'pytest_explicit' ↓
cause Conflicting pytest plugins or an outdated version of pytest-explicit.
fix
Upgrade pytest-explicit:
pip install --upgrade pytest-explicit; if persists, reinstall with pip install --force-reinstall pytest-explicit. Warnings
gotcha The marker name is `explicit`, not `explicitly` or `explicit_test`. Typos will not be recognized by the plugin and the test will run normally, causing confusion. ↓
fix Use exactly `@pytest.mark.explicit` (spelling: e-x-p-l-i-c-i-t).
gotcha The `--explicit` flag must be placed before any positional arguments or test file paths. If placed after, it may be ignored. ↓
fix Run `pytest --explicit tests/` instead of `pytest tests/ --explicit`.
deprecated This plugin has not been updated since 2021 and may not be compatible with newer pytest versions (e.g., pytest 8+). No known breaking changes as of pytest 7.x. ↓
fix Test your pytest version; if incompatible, consider using pytest's built-in `--markers` or `-k` expressions.
Imports
- pytest.mark.explicit
import pytest - --explicit
pytest --explicit
Quickstart
# test_example.py
import pytest
@pytest.mark.explicit
def test_slow():
assert True
def test_fast():
assert True
# Run with: pytest --explicit # runs both
# Run without: pytest # skips test_slow