or the xfail way:
python
def test_feature_x():
    pytest.xfail("expected to fail until bug XYZ is fixed")

Here is how to skip all tests in a module if some import is missing:

python
docutils = pytest.importorskip("docutils", minversion="0.3")

Skip a test based on a condition: