1
0

- Add patch remove-mock.patch:

* Remove use of mock.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-kafka-python?expand=0&rev=23
This commit is contained in:
Steve Kowalik 2022-10-11 06:50:34 +00:00 committed by Git OBS Bridge
parent b939117e3e
commit 8e4d278cb4
3 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 11 06:50:00 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-mock.patch:
* Remove use of mock.
-------------------------------------------------------------------
Tue Sep 6 14:12:44 UTC 2022 - John Vandenberg <jayvdb@gmail.com>

View File

@ -29,6 +29,8 @@ Source1: https://raw.githubusercontent.com/dpkp/kafka-python/master/serve
Source2: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/conftest.py
Source3: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/fixtures.py
Source4: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/service.py
# PATCH-FIX-OPENSUSE Remove use of mock module
Patch0: remove-mock.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -39,7 +41,6 @@ Suggests: python-xxhash
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module lz4}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-snappy}
@ -55,7 +56,7 @@ protocol as well as broker-aware request routing. Gzip and Snappy compression
is also supported for message sets.
%prep
%setup -q -n kafka-python-%{version}
%autosetup -p1 -n kafka-python-%{version}
mkdir -p servers/0.11.0.2/resources/
cp %{SOURCE1} servers/0.11.0.2/resources/

16
remove-mock.patch Normal file
View File

@ -0,0 +1,16 @@
Index: kafka-python-2.0.2/test/test_consumer_integration.py
===================================================================
--- kafka-python-2.0.2.orig/test/test_consumer_integration.py
+++ kafka-python-2.0.2/test/test_consumer_integration.py
@@ -1,7 +1,10 @@
import logging
import time
-from mock import patch
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
import pytest
from kafka.vendor.six.moves import range