Created
August 8, 2022 16:36
-
-
Save abadger/2e6c53fb524d1a5f4a01109ce4e1c184 to your computer and use it in GitHub Desktop.
full pytest testcase using get_marker on older pytest.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture | |
def system_cert_with_target_path(request): | |
print(pytest.__version__) | |
print(request.node) | |
print(dir(request.node)) | |
if pytest.__version__.split('.') <= ('3', '6', '0'): | |
mark = request.node.get_marker("cert_filename") | |
else: | |
mark = request.node.get_closest_marker("cert_filename") | |
print(mark) | |
return mark | |
@pytest.mark.cert_filename('test') | |
def test_thing(system_cert_with_target_path): | |
print(system_cert_with_target_path) | |
assert False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment