Registry / testing / pytest-skip-markers

pytest-skip-markers

JSON →
library1.5.2pypypiunverified

A pytest plugin providing a set of skip markers based on operating system, Python version, environment variables, and other conditions. Version 1.5.2 (released 2024-07-31) supports Python >=3.8. Maintained by SaltStack.

pip install pytest-skip-markers
INSTALL
IMPORT
SIG · PYTEST-SKIP-MARKER
P
pytest-skip-markers
testingpythonv1.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

skip_on_windows
from pytestskipmarkers import skip_on_windows
from pytest_skip_markers import skip_on_windows

Basic usage of skip markers for OS and environment.

import pytest from pytest_skip_markers import skip_on_windows, skip_unless_on_linux @pytest.mark.skip_on_windows @pytest.mark.skip_unless_on_linux class TestExample: def test_linux_only(self): pass @pytest.mark.skip_if_env('CI') def test_ci_only(): pass
Debug
Known issues
gotchaMarker names in the plugin use underscores (e.g., skip_on_windows), but pytest's standard skip marker is skipif. Do not confuse them.
fix
Use 'pytest.mark.skip_on_windows' exactly as provided.
affects: all
gotchaThe plugin's markers only work if the plugin is installed. If the plugin is not installed, the custom markers will cause a 'Unknown mark' error.
fix
Ensure pytest-skip-markers is installed in the test environment.
affects: all
gotchaThe skip_unless_on_os markers (e.g., skip_unless_on_linux) will skip the test if the condition is not met, not just on non-matching OS.
fix
Use skip_unless_on_linux to run only on Linux; use skip_on_linux to skip on Linux.
affects: all
gotchaEnvironment variable checking with skip_if_env is case-sensitive on some platforms. Use consistent casing.
fix
For versions <1.5.0, ensure exact case; upgrade to >=1.5.0 for better handling.
affects: <1.5.0
Upgrade
Version history
1.5.2latest on PyPI · released Aug 9, 2024
Audit
Dependencies
pytestrequiredPlugin requires pytest to run.
Agent activity
7 hits · last 30 days
node
6
Bingbot
1
Resources
pytest-skip-markers — pip install pytest-skip-markers · libregistry