Pytest utilities and fixtures¶
Important
For these helpers to work, you need to install extra_platforms
’s additional dependencies from the pytest
extra group:
$ pip install extra_platforms[pytest]
Todo
Write examples and tutorial.
extra_platforms.pytest
API¶
Pytest decorators to skip tests depending on the platform they’re run on.
- extra_platforms.pytest.skip_linux(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(True,), kwargs={'reason': 'Skip Linux'}))¶
Pytest mark to skip a test if run on a Linux system.
- extra_platforms.pytest.skip_macos(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(False,), kwargs={'reason': 'Skip macOS'}))¶
Pytest mark to skip a test if run on a macOS system.
- extra_platforms.pytest.skip_windows(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(False,), kwargs={'reason': 'Skip Windows'}))¶
Pytest mark to skip a test if run on a Windows system.
- extra_platforms.pytest.unless_linux(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(False,), kwargs={'reason': 'Linux required'}))¶
Pytest mark to skip a test unless it is run on a Linux system.
- extra_platforms.pytest.unless_macos(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(True,), kwargs={'reason': 'macOS required'}))¶
Pytest mark to skip a test unless it is run on a macOS system.
- extra_platforms.pytest.unless_windows(*args, **kwargs) = MarkDecorator(mark=Mark(name='skipif', args=(True,), kwargs={'reason': 'Windows required'}))¶
Pytest mark to skip a test unless it is run on a Windows system.