14
0

Accepting request 855341 from home:mcepl:branches:devel:tools:scm

- Add remove_mock.patch to remove dependency on the external mock

OBS-URL: https://build.opensuse.org/request/show/855341
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests-toolbelt?expand=0&rev=16
This commit is contained in:
2020-12-12 12:13:15 +00:00
committed by Git OBS Bridge
parent d8e3d5988c
commit c8596ae951
3 changed files with 183 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Dec 7 08:09:35 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add remove_mock.patch to remove dependency on the external mock
------------------------------------------------------------------- -------------------------------------------------------------------
Mon May 6 14:06:37 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> Mon May 6 14:06:37 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-requests-toolbelt # spec file for package python-requests-toolbelt
# #
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2020 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,9 @@ Group: Development/Languages/Python
URL: https://github.com/requests/toolbelt URL: https://github.com/requests/toolbelt
Source: https://files.pythonhosted.org/packages/source/r/requests-toolbelt/requests-toolbelt-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/r/requests-toolbelt/requests-toolbelt-%{version}.tar.gz
Patch0: fix-tests.patch Patch0: fix-tests.patch
# PATCH-FIX-UPSTREAM remove_mock.patch bsc#[0-9]+ mcepl@suse.com
# remove dependency on the external mock package
Patch1: remove_mock.patch
BuildRequires: %{python_module requests >= 2.12.2} BuildRequires: %{python_module requests >= 2.12.2}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
@@ -34,7 +37,6 @@ Requires: python-requests >= 2.12.2
BuildArch: noarch BuildArch: noarch
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module betamax >= 0.5.0} BuildRequires: %{python_module betamax >= 0.5.0}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pyOpenSSL} BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
# /SECTION # /SECTION
@@ -47,8 +49,8 @@ really belong in ``requests`` proper. The minimum tested requests version is
some idiosyncracies prevent effective or sane testing on that version. some idiosyncracies prevent effective or sane testing on that version.
%prep %prep
%setup -q -n requests-toolbelt-%{version} %autosetup -p1 -n requests-toolbelt-%{version}
%patch0 -p1
rm -rf requests_toolbelt.egg-info rm -rf requests_toolbelt.egg-info
# requires network access # requires network access
rm -v tests/test_multipart_encoder.py rm -v tests/test_multipart_encoder.py

172
remove_mock.patch Normal file
View File

@@ -0,0 +1,172 @@
---
dev-requirements.txt | 1 -
tests/test_appengine_adapter.py | 2 +-
tests/test_auth.py | 2 +-
tests/test_downloadutils.py | 2 +-
tests/test_dump.py | 2 +-
tests/test_multipart_decoder.py | 2 +-
tests/test_proxy_digest_auth.py | 2 +-
tests/test_socket_options_adapter.py | 2 +-
tests/test_ssladapter.py | 2 +-
tests/threaded/test_api.py | 2 +-
tests/threaded/test_pool.py | 2 +-
tests/threaded/test_thread.py | 2 +-
tox.ini | 1 -
13 files changed, 11 insertions(+), 13 deletions(-)
--- a/tests/test_appengine_adapter.py
+++ b/tests/test_appengine_adapter.py
@@ -2,7 +2,7 @@
"""Tests for the AppEngineAdapter."""
import sys
-import mock
+from unittest import mock
import pytest
import requests
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import requests
import unittest
-import mock
+from unittest import mock
from requests_toolbelt.auth.guess import GuessAuth, GuessProxyAuth
from . import get_betamax
--- a/tests/test_downloadutils.py
+++ b/tests/test_downloadutils.py
@@ -8,7 +8,7 @@ import tempfile
import requests
from requests_toolbelt.downloadutils import stream
from requests_toolbelt.downloadutils import tee
-import mock
+from unittest import mock
import pytest
from . import get_betamax
--- a/tests/test_dump.py
+++ b/tests/test_dump.py
@@ -12,7 +12,7 @@ very complex and high-level.
from requests_toolbelt._compat import HTTPHeaderDict
from requests_toolbelt.utils import dump
-import mock
+from unittest import mock
import pytest
import requests
--- a/tests/test_multipart_decoder.py
+++ b/tests/test_multipart_decoder.py
@@ -2,7 +2,7 @@
import io
import sys
import unittest
-import mock
+from unittest import mock
import pytest
import requests
from requests_toolbelt.multipart.decoder import BodyPart
--- a/tests/test_proxy_digest_auth.py
+++ b/tests/test_proxy_digest_auth.py
@@ -2,7 +2,7 @@
"""Test proxy digest authentication."""
import unittest
-import mock
+from unittest import mock
import requests
from requests_toolbelt.auth import http_proxy_digest
--- a/tests/test_socket_options_adapter.py
+++ b/tests/test_socket_options_adapter.py
@@ -3,7 +3,7 @@
import contextlib
import socket
-import mock
+from unittest import mock
import requests
from requests_toolbelt._compat import poolmanager
--- a/tests/test_ssladapter.py
+++ b/tests/test_ssladapter.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-import mock
+from unittest import mock
import pytest
import requests
import unittest
--- a/tests/threaded/test_api.py
+++ b/tests/threaded/test_api.py
@@ -1,6 +1,6 @@
"""Module containing tests for requests_toolbelt.threaded API."""
-import mock
+from unittest import mock
import pytest
from requests_toolbelt._compat import queue
--- a/tests/threaded/test_pool.py
+++ b/tests/threaded/test_pool.py
@@ -5,7 +5,7 @@ except ImportError:
import Queue as queue
import unittest
-import mock
+from unittest import mock
import pytest
from requests_toolbelt.threaded import pool
--- a/tests/threaded/test_thread.py
+++ b/tests/threaded/test_thread.py
@@ -7,7 +7,7 @@ import threading
import unittest
import uuid
-import mock
+from unittest import mock
import requests.exceptions
from requests_toolbelt.threaded import thread
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,4 +1,3 @@
pytest
-mock
pyopenssl
git+git://github.com/sigmavirus24/betamax
--- a/tox.ini
+++ b/tox.ini
@@ -6,7 +6,6 @@ pip_pre = False
deps =
requests{env:REQUESTS_VERSION:>=2.0.1,<3.0.0}
pytest
- mock
pyopenssl
ndg-httpsclient
betamax>0.5.0
--- a/tests/test_source_adapter.py
+++ b/tests/test_source_adapter.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from requests.adapters import DEFAULT_POOLSIZE, DEFAULT_POOLBLOCK
-from mock import patch
+from unittest.mock import patch
from requests_toolbelt.adapters.source import SourceAddressAdapter
import pytest
--- a/tests/test_user_agent.py
+++ b/tests/test_user_agent.py
@@ -2,7 +2,7 @@
import unittest
import sys
-from mock import patch
+from unittest.mock import patch
import pytest
from requests_toolbelt.utils import user_agent as ua