[packages/python3-httpretty] - updated tests and doc build
qboosh
qboosh at pld-linux.org
Sun Mar 15 10:19:26 CET 2026
commit eedcab8be266e85b646bc3d324ad1eac5b98c35d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Mar 15 10:19:32 2026 +0100
- updated tests and doc build
httpretty-mock.patch | 12 +++++++++++
python3-httpretty.spec | 56 +++++++++++++++++++++++++++++++++++---------------
2 files changed, 51 insertions(+), 17 deletions(-)
---
diff --git a/python3-httpretty.spec b/python3-httpretty.spec
index 6598301..1229292 100644
--- a/python3-httpretty.spec
+++ b/python3-httpretty.spec
@@ -1,7 +1,7 @@
#
# Conditional build:
-%bcond_with tests # unit/functional tests
-%bcond_with doc # build Sphinx documentation (already built docs included in dist as of 0.9.7)
+%bcond_without tests # unit/functional tests
+%bcond_without doc # Sphinx documentation
%define module httpretty
Summary: HTTP client mock for Python
@@ -14,27 +14,37 @@ Group: Libraries/Python
#Source0Download: https://pypi.org/simple/httpretty/
Source0: https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
# Source0-md5: 6f00d23684900c645aba1bb46b2eb320
+Patch0: httpretty-mock.patch
URL: https://httpretty.readthedocs.io/
BuildRequires: python3-modules >= 1:3.6
BuildRequires: python3-setuptools
%if %{with tests}
-BuildRequires: python3-coverage
-BuildRequires: python3-httplib2
-BuildRequires: python3-rednose
+BuildRequires: python3-boto3 >= 1.17.72
+BuildRequires: python3-coverage >= 5.0.3
+BuildRequires: python3-cryptography >= 2.8
+BuildRequires: python3-eventlet >= 0.25.1
+BuildRequires: python3-freezegun >= 0.3.15
+BuildRequires: python3-httplib2 >= 0.17.0
+BuildRequires: python3-httpx >= 0.18.1
+BuildRequires: python3-pyOpenSSL >= 19.1.0
+#BuildRequires: python3-nose-randomly >= 1.2.6
+BuildRequires: python3-pynose >= 1.3.7
+BuildRequires: python3-pytest
+BuildRequires: python3-pytest-mypy >= 0.8.1
+BuildRequires: python3-redis >= 3.4.1
+BuildRequires: python3-rednose >= 1.3.0
BuildRequires: python3-requests
-BuildRequires: python3-six >= 1.11.0
-BuildRequires: python3-sure >= 1.2.24
-BuildRequires: python3-tornado
-BuildRequires: python3-urllib3
-BuildRequires: python3-http3
-BuildRequires: python3-botox
-BuildRequires: python3-mock
+BuildRequires: python3-sure >= 1.4.11
+BuildRequires: python3-tornado >= 6.0.4
+BuildRequires: python3-types-requests
+BuildRequires: python3-urllib3 >= 1.25.8
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with doc}
-BuildRequires: python3-sphinx_rtd_theme
-BuildRequires: sphinx-pdg-3
+BuildRequires: python3-sphinx_rtd_theme >= 0.5.2
+BuildRequires: python3-sphinxcontrib-asciinema >= 0.3.2
+BuildRequires: sphinx-pdg-3 >= 4.0.2
%endif
Requires: python3-modules >= 1:3.6
BuildArch: noarch
@@ -59,15 +69,27 @@ Dokumentacja API modułu Pythona httpretty.
%prep
%setup -q -n %{module}-%{version}
+%patch -P0 -p1
%build
%py3_build
%if %{with tests}
-# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
+# tests/functional require network, skipped
+# some tests/bugfixes/nosetests/test_*.py fail due to recent requests creating socket, which is denied by allow_net_connect=False
+# tests/bugfixes/nosetests/test_414_httpx.py is broken due to httpx/eventlet conflict
+nosetests-%{py3_ver} tests/unit tests/bugfixes/nosetests tests/pyopenssl \
+ --ignore-files=test_387_regex_port \
+ --ignore-files=test_388_unmocked_error_with_url \
+ --ignore-files=test_413_regex \
+ --ignore-files=test_414_httpx \
+ --ignore-files=test_416_boto3 \
+ --ignore-files=test_430_respect_timeout
+
+# TestBug426MypySegfaultWithCallbackAndPayload instances fail due to recent requests creating socket, which is denied by allow_net_connect=False
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS= \
-%{__python3} -m pytest tests
+PYTEST_PLUGINS=pytest_mypy \
+%{__python3} -m pytest --maxfail=1 --mypy tests/bugfixes/pytest -k 'not TestBug426MypySegfaultWithCallbackAndPayload'
%endif
%if %{with doc}
diff --git a/httpretty-mock.patch b/httpretty-mock.patch
new file mode 100644
index 0000000..a6b3684
--- /dev/null
+++ b/httpretty-mock.patch
@@ -0,0 +1,12 @@
+--- httpretty-1.1.4/tests/functional/test_fakesocket.py.orig 2021-05-14 03:02:06.000000000 +0200
++++ httpretty-1.1.4/tests/functional/test_fakesocket.py 2026-03-14 12:44:03.424456316 +0100
+@@ -27,8 +27,7 @@
+
+ import functools
+ import socket
+-
+-import mock
++from unittest import mock
+
+
+ class FakeSocket(socket.socket):
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-httpretty.git/commitdiff/eedcab8be266e85b646bc3d324ad1eac5b98c35d
More information about the pld-cvs-commit
mailing list