From f6aa2ae3d06920e85d28483198c97beb98951d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Mon, 18 Sep 2023 15:02:38 -0600 Subject: [PATCH] test: Simplify `xfail` due to missing features (#978) * test: Add an `_xfail_due_to_version` helper function * Revert "test: Add an `_xfail_due_to_version` helper function" This reverts commit 437c1925dcc0d124fbf854afeec39806764c58fc. * Simplify xfails due to missing features --- tests/test_integration.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index d896a61c..44d10f24 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -257,16 +257,16 @@ def test_quota( survey_id: int, ): """Test quota methods.""" - if server_version < (6, 0, 0): - request.node.add_marker( - pytest.mark.xfail( - reason=( - "Quota RPC methods are not supported in LimeSurvey " - f"{server_version} < 6.0.0" - ), - raises=requests.exceptions.HTTPError, + request.node.add_marker( + pytest.mark.xfail( + server_version < (6, 0, 0), + reason=( + "Quota RPC methods are not supported in LimeSurvey " + f"{server_version} < 6.0.0" ), - ) + raises=requests.exceptions.HTTPError, + ), + ) with pytest.raises(LimeSurveyStatusError, match="No quotas found"): client.list_quotas(survey_id) @@ -566,16 +566,16 @@ def test_get_available_site_settings( server_version: semver.Version, ): """Test getting available site settings.""" - if server_version < (6, 0, 0): - request.node.add_marker( - pytest.mark.xfail( - reason=( - "RPC method `get_available_site_settings` is not supported in " - f"LimeSurvey {server_version} < 6.0.0" - ), - raises=requests.exceptions.HTTPError, + request.node.add_marker( + pytest.mark.xfail( + server_version < (6, 0, 0), + reason=( + "RPC method `get_available_site_settings` is not supported in " + f"LimeSurvey {server_version} < 6.0.0" ), - ) + raises=requests.exceptions.HTTPError, + ), + ) assert client.get_available_site_settings()