From 3d0faa10762a803d4a75e658956b5aa72bef39be Mon Sep 17 00:00:00 2001 From: Simo Sorce 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 --- 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