Fix build with hypothesis 5

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1830961
This commit is contained in:
Miro Hrončok 2020-05-11 12:36:52 +02:00
parent 818bc768ca
commit 627f9318ab
2 changed files with 88 additions and 1 deletions

81
572.patch Normal file
View File

@ -0,0 +1,81 @@
From f26fc9dae2004ec812697e13d2a9aafa0e931e85 Mon Sep 17 00:00:00 2001
From: Alex Gaynor <alex.gaynor@gmail.com>
Date: Sun, 12 Jan 2020 22:15:54 -0500
Subject: [PATCH 1/2] Fix the tests
---
tests/test_aead.py | 4 ++--
tests/test_pwhash.py | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/test_aead.py b/tests/test_aead.py
index 1fa32a2b..d5c58d56 100644
--- a/tests/test_aead.py
+++ b/tests/test_aead.py
@@ -18,7 +18,7 @@
import sys
from collections import namedtuple
-from hypothesis import given, settings, unlimited
+from hypothesis import given, settings
from hypothesis.strategies import binary, sampled_from
import pytest
@@ -97,7 +97,7 @@ def test_chacha20poly1305_variants_kat(kv):
max_size=b.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES),
binary(min_size=b.crypto_aead_chacha20poly1305_KEYBYTES,
max_size=b.crypto_aead_chacha20poly1305_KEYBYTES))
-@settings(deadline=None, max_examples=20, timeout=unlimited)
+@settings(deadline=None, max_examples=20)
def test_chacha20poly1305_variants_roundtrip(construction,
message,
aad,
diff --git a/tests/test_pwhash.py b/tests/test_pwhash.py
index ac603665..9e53966b 100644
--- a/tests/test_pwhash.py
+++ b/tests/test_pwhash.py
@@ -20,7 +20,7 @@
import sys
import unicodedata as ud
-from hypothesis import given, settings, unlimited
+from hypothesis import given, settings
from hypothesis.strategies import integers, text
import pytest
@@ -410,7 +410,7 @@ def test_str_verify_argon2_ref_fail(password_hash, password):
integers(min_value=1024 * 1024,
max_value=16 * 1024 * 1024)
)
-@settings(deadline=None, max_examples=20, timeout=unlimited)
+@settings(deadline=None, max_examples=20)
def test_argon2i_str_and_verify(password, ops, mem):
_psw = password.encode('utf-8')
pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem)
@@ -424,7 +424,7 @@ def test_argon2i_str_and_verify(password, ops, mem):
integers(min_value=1024 * 1024,
max_value=16 * 1024 * 1024)
)
-@settings(deadline=None, max_examples=20, timeout=unlimited)
+@settings(deadline=None, max_examples=20)
def test_argon2id_str_and_verify(password, ops, mem):
_psw = password.encode('utf-8')
pw_hash = nacl.pwhash.argon2id.str(_psw, opslimit=ops, memlimit=mem)
@@ -438,7 +438,7 @@ def test_argon2id_str_and_verify(password, ops, mem):
integers(min_value=1024 * 1024,
max_value=16 * 1024 * 1024)
)
-@settings(deadline=None, max_examples=20, timeout=unlimited)
+@settings(deadline=None, max_examples=20)
def test_argon2i_str_and_verify_fail(password, ops, mem):
_psw = password.encode('utf-8')
pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem)
@@ -447,7 +447,7 @@ def test_argon2i_str_and_verify_fail(password, ops, mem):
@given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20))
-@settings(deadline=None, max_examples=5, timeout=unlimited)
+@settings(deadline=None, max_examples=5)
def test_pwhash_str_and_verify(password):
_psw = password.encode('utf-8')

View File

@ -5,7 +5,7 @@
Name: python-%{modname}
Version: 1.3.0
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Python binding to the Networking and Cryptography (NaCl) library
License: ASL 2.0
@ -15,6 +15,9 @@ Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
# hypothesis 4 support
Patch1: %{url}/pull/480.patch
# hypothesis 5 support
Patch2: %{url}/pull/572.patch
BuildRequires: gcc
BuildRequires: libsodium-devel
@ -72,6 +75,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} py.test-3 -v
%{python3_sitearch}/nacl/
%changelog
* Mon May 11 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-7
- Fix build with hypothesis 5 (#1830961)
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild