From 9f86bca8b18880ad75fc82819bf97b303d329ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 15 Apr 2019 17:56:04 +0200 Subject: [PATCH] Pytest 4 compatibility Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1694177 --- ...4dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch | 34 +++++++++++++++++++ python-pip.spec | 4 +++ 2 files changed, 38 insertions(+) create mode 100644 d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch diff --git a/d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch b/d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch new file mode 100644 index 0000000..75310f3 --- /dev/null +++ b/d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch @@ -0,0 +1,34 @@ +From d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 29 Mar 2019 18:36:45 +0100 +Subject: [PATCH] Pytest: Use get_closest_marker + +See https://github.com/pytest-dev/pytest/pull/4564 +--- + tests/conftest.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 6b2f3e3291..aed2f5a5ec 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -32,15 +32,16 @@ def pytest_collection_modifyitems(config, items): + continue + + # Mark network tests as flaky +- if item.get_marker('network') is not None and "CI" in os.environ: ++ if (item.get_closest_marker('network') is not None and ++ "CI" in os.environ): + item.add_marker(pytest.mark.flaky(reruns=3)) + + if six.PY3: +- if (item.get_marker('incompatible_with_test_venv') and ++ if (item.get_closest_marker('incompatible_with_test_venv') and + config.getoption("--use-venv")): + item.add_marker(pytest.mark.skip( + 'Incompatible with test venv')) +- if (item.get_marker('incompatible_with_venv') and ++ if (item.get_closest_marker('incompatible_with_venv') and + sys.prefix != sys.base_prefix): + item.add_marker(pytest.mark.skip( + 'Incompatible with venv')) diff --git a/python-pip.spec b/python-pip.spec index 45106d4..b160585 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -101,6 +101,9 @@ Patch3: remove-existing-dist-only-if-path-conflicts.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1655253 Patch4: dummy-certifi.patch +# pytest 4 support +Patch5: https://github.com/pypa/pip/commit/d4264dc3b2ab292c9843fb1d001c7fc0a5fc67c4.patch + # Downstream only patch # Users might have local installations of pip from using # `pip install --user --upgrade pip` on older versions. @@ -272,6 +275,7 @@ popd %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem