Hello community,
here is the log from the commit of package python-natsort for
openSUSE:Leap:15.2 checked in at 2020-05-28 20:11:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-natsort (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-natsort.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-natsort"
Thu May 28 20:11:14 2020 rev:4 rq:809798 version:6.0.0
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-natsort/python-natsort.changes
2020-01-15 15:50:44.291504871 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-natsort.new.3606/python-natsort.changes
2020-05-28 20:11:15.099194647 +0200
@@ -1,0 +2,6 @@
+Thu May 28 07:23:06 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Add patch to fix build with new pytest-mock:
+ * pytest-mock.patch
+
+-------------------------------------------------------------------
New:
----
pytest-mock.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-natsort.spec ++++++
--- /var/tmp/diff_new_pack.cXYxhD/_old 2020-05-28 20:11:15.467195742 +0200
+++ /var/tmp/diff_new_pack.cXYxhD/_new 2020-05-28 20:11:15.467195742 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-natsort
#
-# 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
@@ -22,9 +22,9 @@
Release: 0
Summary: Natural sorting in Python
License: MIT
-Group: Development/Languages/Python
URL: https://github.com/SethMMorton/natsort
Source:
https://files.pythonhosted.org/packages/source/n/natsort/natsort-%{version}.tar.gz
+Patch0: pytest-mock.patch
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-mock}
@@ -50,6 +50,7 @@
%prep
%setup -q -n natsort-%{version}
+%patch0 -p1
%build
%python_build
@@ -64,9 +65,7 @@
%check
export LANG=en_US.UTF8
-%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
-pytest-%{$python_bin_suffix}
-}
+%pytest
%files %{python_files}
%license LICENSE
++++++ pytest-mock.patch ++++++
>From 3a3bd474bf97b3b3440a8fe8714072f730ddf365 Mon Sep 17 00:00:00 2001
From: Seth Morton <[email protected]>
Date: Mon, 6 Jan 2020 20:31:53 -0800
Subject: [PATCH] Fix bug caused by pytest-mocker API being removed
mocker.patch no longer supports context managers. Not sure why I was
using it in a context manager in the first place...
This closes issue #107.
---
tests/test_natsort_keygen.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: natsort-6.0.0/tests/test_natsort_keygen.py
===================================================================
--- natsort-6.0.0.orig/tests/test_natsort_keygen.py
+++ natsort-6.0.0/tests/test_natsort_keygen.py
@@ -150,9 +150,9 @@ def test_natsort_keygen_with_locale(mock
expected[1][1][i] = strxfrm(expected[1][1][i])
expected = tuple(tuple(tuple(subsub) for subsub in sub) for sub in
expected)
- with mocker.patch("natsort.compat.locale.dumb_sort", return_value=is_dumb):
- ns_key = natsort_keygen(alg=alg)
- assert ns_key(arbitrary_input) == expected
+ mocker.patch("natsort.compat.locale.dumb_sort", return_value=is_dumb)
+ ns_key = natsort_keygen(alg=alg)
+ assert ns_key(arbitrary_input) == expected
@pytest.mark.parametrize(
@@ -163,6 +163,6 @@ def test_natsort_keygen_with_locale(mock
@pytest.mark.usefixtures("with_locale_en_us")
def test_natsort_keygen_with_locale_bytes(mocker, bytes_input, alg, is_dumb):
expected = (b"6A-5.034e+1",)
- with mocker.patch("natsort.compat.locale.dumb_sort", return_value=is_dumb):
- ns_key = natsort_keygen(alg=alg)
- assert ns_key(bytes_input) == expected
+ mocker.patch("natsort.compat.locale.dumb_sort", return_value=is_dumb)
+ ns_key = natsort_keygen(alg=alg)
+ assert ns_key(bytes_input) == expected
Index: natsort-6.0.0/tests/test_natsort_cmp.py
===================================================================
--- natsort-6.0.0.orig/tests/test_natsort_cmp.py
+++ natsort-6.0.0/tests/test_natsort_cmp.py
@@ -44,17 +44,17 @@ class TestNatCmp:
natcmp(0, 0)
assert len(natcmp.cached_keys) == 1
- with mocker.patch("natsort.compat.locale.dumb_sort",
return_value=False):
- natcmp(0, 0, alg=ns.L)
- assert len(natcmp.cached_keys) == 2
- natcmp(0, 0, alg=ns.L)
- assert len(natcmp.cached_keys) == 2
+ mocker.patch("natsort.compat.locale.dumb_sort", return_value=False)
+ natcmp(0, 0, alg=ns.L)
+ assert len(natcmp.cached_keys) == 2
+ natcmp(0, 0, alg=ns.L)
+ assert len(natcmp.cached_keys) == 2
- with mocker.patch("natsort.compat.locale.dumb_sort",
return_value=True):
- natcmp(0, 0, alg=ns.L)
- assert len(natcmp.cached_keys) == 3
- natcmp(0, 0, alg=ns.L)
- assert len(natcmp.cached_keys) == 3
+ mocker.patch("natsort.compat.locale.dumb_sort", return_value=True)
+ natcmp(0, 0, alg=ns.L)
+ assert len(natcmp.cached_keys) == 3
+ natcmp(0, 0, alg=ns.L)
+ assert len(natcmp.cached_keys) == 3
def test_illegal_algorithm_raises_error(self):
with pytest.raises(ValueError):