From 33bb8ea0e5032312db8bf140a3af33406ef0c6cc Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Nov 26 2018 10:25:10 +0000 Subject: No pytest-httpbin for Python 2 https://bugzilla.redhat.com/show_bug.cgi?id=1653223 --- diff --git a/python-requests.spec b/python-requests.spec index 769da5d..d49fda5 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -10,7 +10,7 @@ Name: python-requests Version: 2.20.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: HTTP library, written in Python, for human beings License: ASL 2.0 @@ -33,6 +33,9 @@ Patch3: requests-2.12.4-tests_nonet.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1567862 Patch4: Don-t-inject-pyopenssl-into-urllib3.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1653223 +Patch5: requests-2.20.0-no-py2-httpbin.patch + BuildArch: noarch %description @@ -52,7 +55,6 @@ BuildRequires: python2-idna %if %{with tests} BuildRequires: python2-pytest BuildRequires: python2-pytest-cov -BuildRequires: python2-pytest-httpbin BuildRequires: python2-pytest-mock %endif @@ -139,6 +141,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v %changelog +* Mon Nov 26 2018 Miro Hrončok - 2.20.0-2 +- No pytest-httpbin for Python 2 + * Mon Oct 29 2018 Jeremy Cline - 2.20.0-1 - Update to v2.20.0 diff --git a/requests-2.20.0-no-py2-httpbin.patch b/requests-2.20.0-no-py2-httpbin.patch new file mode 100644 index 0000000..c3f60b1 --- /dev/null +++ b/requests-2.20.0-no-py2-httpbin.patch @@ -0,0 +1,34 @@ +diff --git a/tests/conftest.py b/tests/conftest.py +index cd64a76..1d5ddbb 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -14,11 +14,23 @@ def prepare_url(value): + return inner + + +-@pytest.fixture +-def httpbin(httpbin): +- return prepare_url(httpbin) ++import sys + ++if sys.version_info[0] < 3: ++ @pytest.fixture ++ def httpbin(): ++ pytest.skip('No httpbin for Python 2') + +-@pytest.fixture +-def httpbin_secure(httpbin_secure): +- return prepare_url(httpbin_secure) ++ @pytest.fixture ++ def httpbin_secure(): ++ pytest.skip('No httpbin for Python 2') ++ ++else: ++ @pytest.fixture ++ def httpbin(httpbin): ++ return prepare_url(httpbin) ++ ++ ++ @pytest.fixture ++ def httpbin_secure(httpbin_secure): ++ return prepare_url(httpbin_secure)