Accepting request 713181 from devel:languages:python

- Add patch to fix build with new pytest:
  * pytest4.patch

OBS-URL: https://build.opensuse.org/request/show/713181
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-PyHamcrest?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2019-07-05 11:48:21 +00:00 committed by Git OBS Bridge
commit ebe123df64
3 changed files with 41 additions and 4 deletions

29
pytest4.patch Normal file
View File

@ -0,0 +1,29 @@
From f71c3c6f8af716435b6d44c007d502b6fb362e20 Mon Sep 17 00:00:00 2001
From: Simon Brunning <simon@brunningonline.net>
Date: Fri, 2 Nov 2018 09:50:20 +0000
Subject: [PATCH] Silence warnings from tests due to use of old
pytest.parameterize() signature.
---
tests/hamcrest_unit_test/base_description_test.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/hamcrest_unit_test/base_description_test.py b/tests/hamcrest_unit_test/base_description_test.py
index 82cd238..60f1862 100644
--- a/tests/hamcrest_unit_test/base_description_test.py
+++ b/tests/hamcrest_unit_test/base_description_test.py
@@ -35,10 +35,10 @@ def test_append_text_delegates(desc):
@pytest.mark.parametrize('described, appended', (
(Described(), 'described'),
- pytest.mark.skipif(six.PY3, reason="py2 only")((six.u('unicode-py2'), "'unicode-py2'")),
- pytest.mark.skipif(six.PY3, reason="py2 only")((six.b('bytes-py2'), "'bytes-py2'")),
- pytest.mark.skipif(six.PY2, reason="py3 only")((six.u('unicode-py3'), "'unicode-py3'")),
- pytest.mark.skipif(six.PY2, reason="py3 only")((six.b('bytes-py3'), "<b'bytes-py3'>")),
+ pytest.param(six.u('unicode-py2'), "'unicode-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")),
+ pytest.param(six.b('bytes-py2'), "'bytes-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")),
+ pytest.param(six.u('unicode-py3'), "'unicode-py3'", marks=pytest.mark.skipif(six.PY2, reason="py3 only")),
+ pytest.param(six.b('bytes-py3'), "<b'bytes-py3'>", marks=pytest.mark.skipif(six.PY2, reason="py3 only")),
(six.u("\U0001F4A9"), six.u("'{0}'").format(six.u("\U0001F4A9"))),
))
def test_append_description_types(desc, described, appended):

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jul 3 08:35:33 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix build with new pytest:
* pytest4.patch
-------------------------------------------------------------------
Wed Oct 17 07:51:50 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-PyHamcrest
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -28,9 +28,10 @@ URL: https://github.com/hamcrest/PyHamcrest
#Source: https://files.pythonhosted.org/packages/source/P/PyHamcrest/PyHamcrest-%%{version}.tar.gz
Source: https://github.com/hamcrest/PyHamcrest/archive/V%{version}.tar.gz
Patch0: 0001-Add-boolean-matchers.patch
Patch1: pytest4.patch
BuildRequires: %{python_module hypothesis >= 1.11}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six >= 1.4}
BuildRequires: fdupes
@ -48,7 +49,8 @@ allowing you to declaratively define “match” rules.
%prep
%setup -q -n PyHamcrest-%{version}
%patch0 -p1
%autopatch -p1
rm pytest.ini
%build
%python_build
@ -58,7 +60,7 @@ allowing you to declaratively define “match” rules.
%python_expand %fdupes %{buildroot}%{$python_sitelib}/hamcrest
%check
%python_exec setup.py test
%pytest
%files %{python_files}
%license LICENSE.txt