2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/docs/conf.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/docs/conf.py
|
|
|
|
+++ urllib3-1.26.3/docs/conf.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -14,7 +14,10 @@ sys.path.insert(0, root_path)
|
2020-12-12 12:58:21 +01:00
|
|
|
# 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
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
class MockModule(mock.Mock):
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/appengine/test_urlfetch.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/appengine/test_urlfetch.py
|
|
|
|
+++ urllib3-1.26.3/test/appengine/test_urlfetch.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -5,7 +5,10 @@ Engine-patched version of httplib to mak
|
2020-12-12 12:58:21 +01:00
|
|
|
import httplib
|
|
|
|
import pytest
|
|
|
|
import StringIO
|
|
|
|
-from mock import patch
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ from unittest.mock import patch
|
|
|
|
+except ImportError:
|
|
|
|
+ from mock import patch
|
2020-12-12 12:58:21 +01:00
|
|
|
|
|
|
|
from ..test_no_ssl import TestWithoutSSL
|
|
|
|
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/contrib/test_pyopenssl.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/contrib/test_pyopenssl.py
|
|
|
|
+++ urllib3-1.26.3/test/contrib/test_pyopenssl.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,7 +1,10 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
try:
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/contrib/test_pyopenssl_dependencies.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/contrib/test_pyopenssl_dependencies.py
|
|
|
|
+++ urllib3-1.26.3/test/contrib/test_pyopenssl_dependencies.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,6 +1,9 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import pytest
|
|
|
|
-from mock import Mock, patch
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ from unittest.mock import Mock, patch
|
|
|
|
+except ImportError:
|
|
|
|
+ from mock import Mock, patch
|
2020-12-12 12:58:21 +01:00
|
|
|
|
|
|
|
try:
|
|
|
|
from urllib3.contrib.pyopenssl import extract_from_urllib3, inject_into_urllib3
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_connection.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_connection.py
|
|
|
|
+++ urllib3-1.26.3/test/test_connection.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,6 +1,9 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
import datetime
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from urllib3.connection import RECENT_DATE, CertificateError, _match_hostname
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_connectionpool.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_connectionpool.py
|
|
|
|
+++ urllib3-1.26.3/test/test_connectionpool.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -6,7 +6,10 @@ from ssl import SSLError as BaseSSLError
|
2020-12-12 12:58:21 +01:00
|
|
|
from test import SHORT_TIMEOUT
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
-from mock import Mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ from unittest.mock import Mock
|
|
|
|
+except ImportError:
|
|
|
|
+ from mock import Mock
|
2020-12-12 12:58:21 +01:00
|
|
|
|
|
|
|
from dummyserver.server import DEFAULT_CA
|
|
|
|
from urllib3._collections import HTTPHeaderDict
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_queue_monkeypatch.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_queue_monkeypatch.py
|
|
|
|
+++ urllib3-1.26.3/test/test_queue_monkeypatch.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,6 +1,9 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from urllib3 import HTTPConnectionPool
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_response.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_response.py
|
|
|
|
+++ urllib3-1.26.3/test/test_response.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -9,7 +9,10 @@ from base64 import b64decode
|
2020-12-12 12:58:21 +01:00
|
|
|
from io import BufferedReader, BytesIO, TextIOWrapper
|
|
|
|
from test import onlyBrotlipy
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
import six
|
|
|
|
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_retry.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_retry.py
|
|
|
|
+++ urllib3-1.26.3/test/test_retry.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,6 +1,9 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
import warnings
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from urllib3.exceptions import (
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_retry_deprecated.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_retry_deprecated.py
|
|
|
|
+++ urllib3-1.26.3/test/test_retry_deprecated.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,7 +1,10 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
# 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
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from urllib3.exceptions import (
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_ssl.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_ssl.py
|
|
|
|
+++ urllib3-1.26.3/test/test_ssl.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -1,6 +1,9 @@
|
2020-12-12 12:58:21 +01:00
|
|
|
from test import notPyPy2
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from urllib3.exceptions import SNIMissingWarning
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_ssltransport.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_ssltransport.py
|
|
|
|
+++ urllib3-1.26.3/test/test_ssltransport.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -4,7 +4,10 @@ import socket
|
2020-12-12 12:58:21 +01:00
|
|
|
import ssl
|
|
|
|
import sys
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from dummyserver.server import DEFAULT_CA, DEFAULT_CERTS
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/test_util.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/test_util.py
|
|
|
|
+++ urllib3-1.26.3/test/test_util.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -9,7 +9,10 @@ from itertools import chain
|
2020-12-12 12:58:21 +01:00
|
|
|
from test import notBrotlipy, onlyBrotlipy, onlyPy2, onlyPy3
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
-from mock import Mock, patch
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ from unittest.mock import Mock, patch
|
|
|
|
+except ImportError:
|
|
|
|
+ from mock import Mock, patch
|
2020-12-12 12:58:21 +01:00
|
|
|
|
|
|
|
from urllib3 import add_stderr_logger, disable_warnings, util
|
|
|
|
from urllib3.exceptions import (
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/with_dummyserver/test_connectionpool.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/with_dummyserver/test_connectionpool.py
|
|
|
|
+++ urllib3-1.26.3/test/with_dummyserver/test_connectionpool.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -10,7 +10,10 @@ import warnings
|
2020-12-12 12:58:21 +01:00
|
|
|
from test import LONG_TIMEOUT, SHORT_TIMEOUT, onlyPy2
|
|
|
|
from threading import Event
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
import six
|
|
|
|
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/with_dummyserver/test_https.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/with_dummyserver/test_https.py
|
|
|
|
+++ urllib3-1.26.3/test/with_dummyserver/test_https.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -19,7 +19,10 @@ from test import (
|
2020-12-12 12:58:21 +01:00
|
|
|
resolvesLocalhostFQDN,
|
|
|
|
)
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
import trustme
|
|
|
|
|
2021-01-29 00:21:12 +01:00
|
|
|
Index: urllib3-1.26.3/test/with_dummyserver/test_socketlevel.py
|
|
|
|
===================================================================
|
|
|
|
--- urllib3-1.26.3.orig/test/with_dummyserver/test_socketlevel.py
|
|
|
|
+++ urllib3-1.26.3/test/with_dummyserver/test_socketlevel.py
|
2020-12-14 08:29:10 +01:00
|
|
|
@@ -52,7 +52,10 @@ from test import (
|
2020-12-12 12:58:21 +01:00
|
|
|
)
|
|
|
|
from threading import Event
|
|
|
|
|
|
|
|
-import mock
|
2020-12-14 08:29:10 +01:00
|
|
|
+try:
|
|
|
|
+ import unittest.mock as mock
|
|
|
|
+except ImportError:
|
|
|
|
+ import mock
|
2020-12-12 12:58:21 +01:00
|
|
|
import pytest
|
|
|
|
import trustme
|
|
|
|
|