From b7b88f1140add0ffb3beec31834a32ec3f0122cc Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Mon, 27 Nov 2023 15:25:21 +0100 Subject: [PATCH] Skip DeathReaper tests when `pydiscourse` is not importable (#443) Depending whether Poetry virtualenv contains `pydiscourse`, it will skip or not `tests.unit.wot.exclusions` pydiscourse is installed when specifying `poetry install --extras deathreaper` https://docs.pytest.org/en/7.1.x/how-to/skipping.html#skipping-on-a-missing-import-dependency --- tests/unit/wot/test_exclusions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/wot/test_exclusions.py b/tests/unit/wot/test_exclusions.py index d76d1f76..73930a56 100644 --- a/tests/unit/wot/test_exclusions.py +++ b/tests/unit/wot/test_exclusions.py @@ -15,6 +15,11 @@ import pytest +pytest.importorskip( + "pydiscourse", + reason="pydiscourse can't be imported, skipping deathreaper tests", +) + from silkaj.wot import exclusions -- GitLab