mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ipatests: Remove no longer needed 'get_marker'
'get_marker' was a compat shim for Pytest < 3.6. Since the requred Pytest is 3.9.1+, the workaround can be removed. Fixes: https://pagure.io/freeipa/issue/8101 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Sergey Orlov <sorlov@redhat.com>
This commit is contained in:
parent
d67846fa36
commit
be6ac7d4c9
@ -137,17 +137,11 @@ def pytest_cmdline_main(config):
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
if isinstance(item, pytest.Function):
|
||||
# pytest 3.6 has deprecated get_marker in 3.6. The method was
|
||||
# removed in 4.x and replaced with get_closest_marker.
|
||||
if hasattr(item, 'get_closest_marker'):
|
||||
get_marker = item.get_closest_marker # pylint: disable=no-member
|
||||
else:
|
||||
get_marker = item.get_marker # pylint: disable=no-member
|
||||
if get_marker('skip_ipaclient_unittest'):
|
||||
if item.get_closest_marker('skip_ipaclient_unittest'):
|
||||
# pylint: disable=no-member
|
||||
if item.config.option.ipaclient_unittests:
|
||||
pytest.skip("Skip in ipaclient unittest mode")
|
||||
if get_marker('needs_ipaapi'):
|
||||
if item.get_closest_marker('needs_ipaapi'):
|
||||
# pylint: disable=no-member
|
||||
if item.config.option.skip_ipaapi:
|
||||
pytest.skip("Skip tests that needs an IPA API")
|
||||
|
Loading…
Reference in New Issue
Block a user