Created
August 8, 2022 17:36
-
-
Save abadger/4448b01107da3bfbe0ebf2a5f383ad81 to your computer and use it in GitHub Desktop.
Possible fix for python-2.6's 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
[root@c2r-20220808100827 convert2rhel]# git diff | |
diff --git a/convert2rhel/unit_tests/conftest.py b/convert2rhel/unit_tests/conftest.py | |
index d608201..3652831 100644 | |
--- a/convert2rhel/unit_tests/conftest.py | |
+++ b/convert2rhel/unit_tests/conftest.py | |
@@ -118,7 +118,11 @@ def system_cert_with_target_path(monkeypatch, tmpdir, request): | |
https://docs.pytest.org/en/7.1.x/how-to/fixtures.html#using-markers-to-pass-data-to-fixtures | |
""" | |
- mark = request.node.get_closest_marker("cert_filename") | |
+ if pytest.__version__.split('.') <= ('3', '6', '0'): | |
+ mark = request.node.get_marker("cert_filename") | |
+ else: | |
+ mark = request.node.get_closest_marker("cert_filename") | |
+ | |
if not mark: | |
temporary_filename = "filename" | |
else: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment