Accepting request 855327 from home:mcepl:branches:devel:tools:scm
- Add remove_mock.patch to remove dependency on the external mock package (gh#urllib3/urllib3#2108). OBS-URL: https://build.opensuse.org/request/show/855327 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=107
This commit is contained in:
parent
36a5e3eac9
commit
27a1b50886
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 11 22:52:59 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Add remove_mock.patch to remove dependency on the external mock
|
||||
package (gh#urllib3/urllib3#2108).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 11 14:18:57 UTC 2020 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
|
@ -37,6 +37,9 @@ URL: https://urllib3.readthedocs.org/
|
||||
Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz
|
||||
# Wrapper for ssl to unbundle ssl_match_hostname
|
||||
Source1: ssl_match_hostname_py3.py
|
||||
# PATCH-FIX-UPSTREAM remove_mock.patch gh#urllib3/urllib3#2108 mcepl@suse.com
|
||||
# remove dependency on the external module mock
|
||||
Patch0: remove_mock.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module six}
|
||||
BuildRequires: fdupes
|
||||
@ -58,7 +61,6 @@ BuildRequires: %{oldpython}
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module PySocks >= 1.5.6}
|
||||
BuildRequires: %{python_module brotlipy >= 0.6.0}
|
||||
BuildRequires: %{python_module mock}
|
||||
BuildRequires: %{python_module psutil}
|
||||
BuildRequires: %{python_module pytest-freezegun}
|
||||
BuildRequires: %{python_module pytest-timeout}
|
||||
@ -87,7 +89,8 @@ Highlights
|
||||
Requests which is also powered by urllib3.
|
||||
|
||||
%prep
|
||||
%setup -q -n urllib3-%{version}
|
||||
%autosetup -p1 -n urllib3-%{version}
|
||||
|
||||
find . -type f -exec chmod a-x '{}' \;
|
||||
find . -name __pycache__ -type d -exec rm -fr {} +
|
||||
|
||||
@ -131,8 +134,8 @@ ln -sf %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc
|
||||
skiplist='test_import_urllib3'
|
||||
# skip some randomly failing tests (mostly on i586, but sometimes they fail on other architectures)
|
||||
skiplist="$skiplist or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification or test_ssl_custom_validation_failure_terminates"
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
export LANG="en_US.UTF8"
|
||||
# gh#urllib3/urllib3#2109
|
||||
skiplist="$skiplist or test_timeout_errors_cause_retries"
|
||||
%pytest -k "not (${skiplist})"
|
||||
%endif
|
||||
|
||||
|
180
remove_mock.patch
Normal file
180
remove_mock.patch
Normal file
@ -0,0 +1,180 @@
|
||||
--- a/docs/conf.py
|
||||
+++ b/docs/conf.py
|
||||
@@ -14,7 +14,7 @@ sys.path.insert(0, root_path)
|
||||
# Mock some expensive/platform-specific modules so build will work.
|
||||
# (https://read-the-docs.readthedocs.io/en/latest/faq.html#\
|
||||
# i-get-import-errors-on-libraries-that-depend-on-c-modules)
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
|
||||
|
||||
class MockModule(mock.Mock):
|
||||
@@ -77,7 +77,7 @@ html_logo = "images/banner.svg"
|
||||
|
||||
html_theme_options = {
|
||||
"announcement": """
|
||||
- <a style=\"text-decoration: none; color: white;\"
|
||||
+ <a style=\"text-decoration: none; color: white;\"
|
||||
href=\"https://opencollective.com/urllib3\">
|
||||
<img src=\"/en/latest/_static/favicon.png\"/> Sponsor urllib3 v2.0 on Open Collective
|
||||
</a>
|
||||
--- a/test/appengine/test_urlfetch.py
|
||||
+++ b/test/appengine/test_urlfetch.py
|
||||
@@ -5,7 +5,7 @@ Engine-patched version of httplib to mak
|
||||
import httplib
|
||||
import pytest
|
||||
import StringIO
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
from ..test_no_ssl import TestWithoutSSL
|
||||
|
||||
--- a/test/contrib/test_pyopenssl.py
|
||||
+++ b/test/contrib/test_pyopenssl.py
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
try:
|
||||
--- a/test/contrib/test_pyopenssl_dependencies.py
|
||||
+++ b/test/contrib/test_pyopenssl_dependencies.py
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
|
||||
try:
|
||||
from urllib3.contrib.pyopenssl import extract_from_urllib3, inject_into_urllib3
|
||||
--- a/test/test_connection.py
|
||||
+++ b/test/test_connection.py
|
||||
@@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from urllib3.connection import RECENT_DATE, CertificateError, _match_hostname
|
||||
--- a/test/test_connectionpool.py
|
||||
+++ b/test/test_connectionpool.py
|
||||
@@ -6,7 +6,7 @@ from ssl import SSLError as BaseSSLError
|
||||
from test import SHORT_TIMEOUT
|
||||
|
||||
import pytest
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from dummyserver.server import DEFAULT_CA
|
||||
from urllib3._collections import HTTPHeaderDict
|
||||
--- a/test/test_queue_monkeypatch.py
|
||||
+++ b/test/test_queue_monkeypatch.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from urllib3 import HTTPConnectionPool
|
||||
--- a/test/test_response.py
|
||||
+++ b/test/test_response.py
|
||||
@@ -9,7 +9,7 @@ from base64 import b64decode
|
||||
from io import BufferedReader, BytesIO, TextIOWrapper
|
||||
from test import onlyBrotlipy
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
import six
|
||||
|
||||
--- a/test/test_retry.py
|
||||
+++ b/test/test_retry.py
|
||||
@@ -1,6 +1,6 @@
|
||||
import warnings
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from urllib3.exceptions import (
|
||||
--- a/test/test_retry_deprecated.py
|
||||
+++ b/test/test_retry_deprecated.py
|
||||
@@ -1,7 +1,7 @@
|
||||
# This is a copy-paste of test_retry.py with extra asserts about deprecated options. It will be removed for v2.
|
||||
import warnings
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from urllib3.exceptions import (
|
||||
--- a/test/test_ssl.py
|
||||
+++ b/test/test_ssl.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from test import notPyPy2
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from urllib3.exceptions import SNIMissingWarning
|
||||
--- a/test/test_ssltransport.py
|
||||
+++ b/test/test_ssltransport.py
|
||||
@@ -4,7 +4,7 @@ import socket
|
||||
import ssl
|
||||
import sys
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
|
||||
from dummyserver.server import DEFAULT_CA, DEFAULT_CERTS
|
||||
--- a/test/test_util.py
|
||||
+++ b/test/test_util.py
|
||||
@@ -9,7 +9,7 @@ from itertools import chain
|
||||
from test import notBrotlipy, onlyBrotlipy, onlyPy2, onlyPy3
|
||||
|
||||
import pytest
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
|
||||
from urllib3 import add_stderr_logger, disable_warnings, util
|
||||
from urllib3.exceptions import (
|
||||
--- a/test/with_dummyserver/test_connectionpool.py
|
||||
+++ b/test/with_dummyserver/test_connectionpool.py
|
||||
@@ -10,7 +10,7 @@ import warnings
|
||||
from test import LONG_TIMEOUT, SHORT_TIMEOUT, onlyPy2
|
||||
from threading import Event
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
import six
|
||||
|
||||
--- a/test/with_dummyserver/test_https.py
|
||||
+++ b/test/with_dummyserver/test_https.py
|
||||
@@ -19,7 +19,7 @@ from test import (
|
||||
resolvesLocalhostFQDN,
|
||||
)
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
import trustme
|
||||
|
||||
--- a/test/with_dummyserver/test_socketlevel.py
|
||||
+++ b/test/with_dummyserver/test_socketlevel.py
|
||||
@@ -52,7 +52,7 @@ from test import (
|
||||
)
|
||||
from threading import Event
|
||||
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
import pytest
|
||||
import trustme
|
||||
|
Loading…
x
Reference in New Issue
Block a user