From 5d3741dade0a411592c9fabceaaabf86b0d2df932f84ced7b31cf1c5db1d6d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Thu, 18 Jul 2019 11:13:25 +0000 Subject: [PATCH] - add fix_tests.patch for new pytest OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyNaCl?expand=0&rev=9 --- fix_tests.patch | 71 +++++++++++++++++++++++++++++++++++++++++++ python-PyNaCl.changes | 5 +++ python-PyNaCl.spec | 3 +- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 fix_tests.patch diff --git a/fix_tests.patch b/fix_tests.patch new file mode 100644 index 0000000..b1786ea --- /dev/null +++ b/fix_tests.patch @@ -0,0 +1,71 @@ +From 3479eaed36a32c6bd91331573a450a5bf099bdd5 Mon Sep 17 00:00:00 2001 +From: Alex Gaynor +Date: Mon, 1 Jul 2019 00:11:38 -0400 +Subject: [PATCH] Fixed tests for change in pytest repr (#546) + +* Fixed tests for change in pytest repr + +* Fixed tests for change in pytest repr + +* Fixed tests for change in pytest repr + +* Fixed tests for change in pytest repr +--- + tests/test_box.py | 2 +- + tests/test_sealed_box.py | 2 +- + tests/test_secret.py | 2 +- + tests/test_signing.py | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_box.py b/tests/test_box.py +index d547ac27..46f3b793 100644 +--- a/tests/test_box.py ++++ b/tests/test_box.py +@@ -268,7 +268,7 @@ def test_box_wrong_length(): + def check_type_error(expected, f, *args): + with pytest.raises(TypeError) as e: + f(*args) +- assert expected in str(e) ++ assert expected in str(e.value) + + + def test_wrong_types(): +diff --git a/tests/test_sealed_box.py b/tests/test_sealed_box.py +index f7ba15c3..49ea2324 100644 +--- a/tests/test_sealed_box.py ++++ b/tests/test_sealed_box.py +@@ -110,7 +110,7 @@ def test_sealed_box_decryption(privalice, pubalice, plaintext, encrypted): + def check_type_error(expected, f, *args): + with pytest.raises(TypeError) as e: + f(*args) +- assert expected in str(e) ++ assert expected in str(e.value) + + + def test_wrong_types(): +diff --git a/tests/test_secret.py b/tests/test_secret.py +index 3b52459a..73987fcb 100644 +--- a/tests/test_secret.py ++++ b/tests/test_secret.py +@@ -142,7 +142,7 @@ def test_secret_box_wrong_lengths(): + def check_type_error(expected, f, *args): + with pytest.raises(TypeError) as e: + f(*args) +- assert expected in str(e) ++ assert expected in str(e.value) + + + def test_wrong_types(): +diff --git a/tests/test_signing.py b/tests/test_signing.py +index 4304afb9..3e2cf359 100644 +--- a/tests/test_signing.py ++++ b/tests/test_signing.py +@@ -219,7 +219,7 @@ def test_key_conversion(self): + def check_type_error(expected, f, *args): + with pytest.raises(TypeError) as e: + f(*args) +- assert expected in str(e) ++ assert expected in str(e.value) + + + def test_wrong_types(): diff --git a/python-PyNaCl.changes b/python-PyNaCl.changes index c26d581..6e6fac8 100644 --- a/python-PyNaCl.changes +++ b/python-PyNaCl.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 18 11:12:47 UTC 2019 - Ondřej Súkup + +- add fix_tests.patch for new pytest + ------------------------------------------------------------------- Mon Jun 3 14:17:29 UTC 2019 - pgajdos@suse.com diff --git a/python-PyNaCl.spec b/python-PyNaCl.spec index 121d412..8ac60d5 100644 --- a/python-PyNaCl.spec +++ b/python-PyNaCl.spec @@ -27,6 +27,7 @@ Url: https://github.com/pyca/pynacl/ Source: https://pypi.org/packages/source/P/PyNaCl/PyNaCl-%{version}.tar.gz # https://github.com/pyca/pynacl/commit/a8c08b18f3a2e8f2140c531afaf42715fcab68e7 Patch0: python-PyNaCl-hypothesis-remove-average_size.patch +Patch1: fix_tests.patch BuildRequires: %{python_module base} BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} @@ -50,7 +51,7 @@ speed. %prep %setup -q -n PyNaCl-%{version} -%patch0 -p1 +%autopatch -p1 rm -Rf src/libsodium %build