14
0
forked from pool/python-PyNaCl

- add fix_tests.patch for new pytest

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyNaCl?expand=0&rev=9
This commit is contained in:
2019-07-18 11:13:25 +00:00
committed by Git OBS Bridge
parent d2302a1307
commit 5d3741dade
3 changed files with 78 additions and 1 deletions

71
fix_tests.patch Normal file
View File

@@ -0,0 +1,71 @@
From 3479eaed36a32c6bd91331573a450a5bf099bdd5 Mon Sep 17 00:00:00 2001
From: Alex Gaynor <alex.gaynor@gmail.com>
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():

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jul 18 11:12:47 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- add fix_tests.patch for new pytest
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jun 3 14:17:29 UTC 2019 - pgajdos@suse.com Mon Jun 3 14:17:29 UTC 2019 - pgajdos@suse.com

View File

@@ -27,6 +27,7 @@ Url: https://github.com/pyca/pynacl/
Source: https://pypi.org/packages/source/P/PyNaCl/PyNaCl-%{version}.tar.gz Source: https://pypi.org/packages/source/P/PyNaCl/PyNaCl-%{version}.tar.gz
# https://github.com/pyca/pynacl/commit/a8c08b18f3a2e8f2140c531afaf42715fcab68e7 # https://github.com/pyca/pynacl/commit/a8c08b18f3a2e8f2140c531afaf42715fcab68e7
Patch0: python-PyNaCl-hypothesis-remove-average_size.patch Patch0: python-PyNaCl-hypothesis-remove-average_size.patch
Patch1: fix_tests.patch
BuildRequires: %{python_module base} BuildRequires: %{python_module base}
BuildRequires: %{python_module cffi} BuildRequires: %{python_module cffi}
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
@@ -50,7 +51,7 @@ speed.
%prep %prep
%setup -q -n PyNaCl-%{version} %setup -q -n PyNaCl-%{version}
%patch0 -p1 %autopatch -p1
rm -Rf src/libsodium rm -Rf src/libsodium
%build %build