#3 No pytest-httpbin for Python 2
Merged 5 years ago by jcline. Opened 5 years ago by churchyard.
rpms/ churchyard/python-requests no2httpbin  into  master

file modified
+7 -2
@@ -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 @@ 

  # 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 @@ 

  %if %{with tests}

  BuildRequires:  python2-pytest

  BuildRequires:  python2-pytest-cov

- BuildRequires:  python2-pytest-httpbin

  BuildRequires:  python2-pytest-mock

  %endif

  
@@ -139,6 +141,9 @@ 

  

  

  %changelog

+ * Mon Nov 26 2018 Miro Hrončok <mhroncok@redhat.com> - 2.20.0-2

+ - No pytest-httpbin for Python 2

+ 

  * Mon Oct 29 2018 Jeremy Cline <jeremy@jcline.org> - 2.20.0-1

  - Update to v2.20.0

  

@@ -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)