custodia/0001-Replace-use-of-pytest-get_marker.patch
Petr Šabata 0405306c3d RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/custodia#a69c7a440fe79f84054ef61fa3ca159b8ba0235e
2020-10-14 23:25:54 +02:00

33 lines
1.1 KiB
Diff

From 3d0faa10762a803d4a75e658956b5aa72bef39be Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Wed, 10 Jul 2019 10:46:59 -0400
Subject: [PATCH] Replace use of pytest get_marker
get_marker has been removed in pytest 4, so replace it with theiur
suggested work around.
Signed-off-by: Simo Sorce <simo@redhat.com>
---
tests/conftest.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index c25e302..2dc7158 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -34,6 +34,8 @@ def pytest_addoption(parser):
def pytest_runtest_setup(item):
skip_servertest = item.config.getoption(SKIP_SERVERTEST)
- if skip_servertest and item.get_marker("servertest") is not None:
- # args has --skip-servertests and test is marked as servertest
- pytest.skip("Skip integration test")
+ if skip_servertest:
+ for marker in item.iter_markers():
+ if marker.name == "servertest":
+ # args has --skip-servertests and test is marked as servertest
+ pytest.skip("Skip integration test")
--
2.21.0