]> git.pld-linux.org Git - packages/python-httpretty.git/commitdiff
- added mock patch (don't require separate mock under py3, use unittest.mock instead) auto/th/python-httpretty-0.9.7-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 7 Jun 2020 08:07:21 +0000 (10:07 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 7 Jun 2020 08:07:21 +0000 (10:07 +0200)
- enabled tests by default

python-httpretty-mock.patch [new file with mode: 0644]
python-httpretty.spec

diff --git a/python-httpretty-mock.patch b/python-httpretty-mock.patch
new file mode 100644 (file)
index 0000000..fda09a2
--- /dev/null
@@ -0,0 +1,67 @@
+--- httpretty-0.9.7/setup.py.orig      2018-11-04 23:34:48.000000000 +0100
++++ httpretty-0.9.7/setup.py   2020-06-07 09:55:21.573933681 +0200
+@@ -41,7 +41,7 @@
+ install_requires = ['six']
+-tests_requires = ['nose', 'sure', 'coverage', 'mock', 'rednose']
++tests_requires = ['nose', 'sure', 'coverage', 'mock;python_version<"3.2"', 'rednose']
+ setup(
+--- httpretty-0.9.7/tests/functional/test_fakesocket.py.orig   2018-11-04 23:34:48.000000000 +0100
++++ httpretty-0.9.7/tests/functional/test_fakesocket.py        2020-06-07 09:57:25.379929633 +0200
+@@ -28,7 +28,10 @@
+ import functools
+ import socket
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ class FakeSocket(socket.socket):
+--- httpretty-0.9.7/tests/functional/test_requests.py.orig     2019-08-26 20:41:12.000000000 +0200
++++ httpretty-0.9.7/tests/functional/test_requests.py  2020-06-07 10:02:50.081503907 +0200
+@@ -816,7 +816,10 @@
+     ("HTTPretty should call a callback function *once* and set its return value"
+      " as the body of the response requests")
+-    from mock import Mock
++    try:
++        from mock import Mock
++    except ImportError:
++        from unittest.mock import Mock
+     def _request_callback(request, uri, headers):
+         return [200, headers, "The {} response from {}".format(decode_utf8(request.method), uri)]
+--- httpretty-0.9.7/tests/unit/test_core.py.orig       2019-08-26 20:41:12.000000000 +0200
++++ httpretty-0.9.7/tests/unit/test_core.py    2020-06-07 10:04:37.994252626 +0200
+@@ -5,7 +5,10 @@
+ import errno
+ from datetime import datetime
+-from mock import Mock, patch, call
++try:
++    from mock import Mock, patch, call
++except ImportError:
++    from unittest.mock import Mock, patch, call
+ from sure import expect
+ from httpretty.compat import StringIO
+--- httpretty-0.9.7/tests/unit/test_main.py.orig       2019-08-26 20:41:12.000000000 +0200
++++ httpretty-0.9.7/tests/unit/test_main.py    2020-06-07 10:05:34.600612630 +0200
+@@ -1,7 +1,10 @@
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+ from __future__ import unicode_literals
+-from mock import patch
++try:
++    from mock import patch
++except ImportError:
++    from unittest.mock import patch
+ import httpretty
+ from httpretty.core import HTTPrettyRequest
index 94b42628d99e2ba961d5ab936c42fa1b3b57df98..0712840c7c327dec0c8a5cda9c2285494c5f8012 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Conditional build:
-%bcond_with    tests   # unit/functional tests
+%bcond_without tests   # unit/functional tests
 %bcond_with    doc     # build Sphinx documentation (already built docs included in dist as of 0.9.7)
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
@@ -17,6 +17,7 @@ Group:                Libraries/Python
 #Source0Download: https://pypi.org/simple/httpretty/
 Source0:       https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
 # Source0-md5: 2fc3d0dc986200be95ce8ad3ef56bc04
+Patch0:                %{name}-mock.patch
 URL:           https://httpretty.readthedocs.io/
 %if %{with python2}
 BuildRequires: python-modules >= 1:2.7
@@ -92,6 +93,7 @@ Dokumentacja API moduĊ‚u Pythona httpretty.
 
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
This page took 0.114616 seconds and 4 git commands to generate.