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

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

OBS-URL: https://build.opensuse.org/request/show/853748
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-genty?expand=0&rev=6
This commit is contained in:
Matej Cepl 2020-12-08 10:22:56 +00:00 committed by Git OBS Bridge
parent 105574c45d
commit c4af3c23fe
3 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Dec 8 07:55:53 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add remove_mock.patch to remove dependency on the external mock package.
-------------------------------------------------------------------
Thu Mar 14 21:04:25 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-genty
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -25,9 +25,10 @@ License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/box/genty
Source: https://files.pythonhosted.org/packages/source/g/genty/genty-%{version}.tar.gz
# PATCH-FEATURE-UPSTREAM remove_mock.patch bsc#[0-9]+ mcepl@suse.com
# Remove dependency on mock
Patch0: remove_mock.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
@ -43,7 +44,7 @@ generative testing, where a single test can execute over a variety of
input. Genty makes this a breeze.
%prep
%setup -q -n genty-%{version}
%autosetup -p1 -n genty-%{version}
%build
%python_build
@ -53,7 +54,7 @@ input. Genty makes this a breeze.
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec setup.py test
%pyunittest discover -v
%files %{python_files}
%license LICENSE

11
remove_mock.patch Normal file
View File

@ -0,0 +1,11 @@
--- a/test/test_genty.py
+++ b/test/test_genty.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import functools
import inspect
-from mock import patch
+from unittest.mock import patch
import six
from genty import genty, genty_args, genty_dataset, genty_repeat, genty_dataprovider
from genty.genty import REPLACE_FOR_PERIOD_CHAR