summary refs log tree commit diff
path: root/pkgs/development/python-modules/pynacl
diff options
context:
space:
mode:
authorValentin Heidelberger <github@valentinsblog.com>2018-02-11 21:04:24 +0100
committerValentin Heidelberger <github@valentinsblog.com>2018-02-11 22:20:12 +0100
commitcb00c506035e34ae3f84993ab90a0733362af81f (patch)
tree3d18ae0008c5042a7fa2cf6be41b66534b75ada4 /pkgs/development/python-modules/pynacl
parent92d68b0656043957dc131962a78d0d515788758b (diff)
downloadnixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar.gz
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar.bz2
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar.lz
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar.xz
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.tar.zst
nixpkgs-cb00c506035e34ae3f84993ab90a0733362af81f.zip
pythonPackages.pynacl: ignore timeout in tests
don't modify test_aead.py yet

add pynacl-no-timeout-and-deadline.patch
Diffstat (limited to 'pkgs/development/python-modules/pynacl')
-rw-r--r--pkgs/development/python-modules/pynacl/default.nix7
-rw-r--r--pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch49
2 files changed, 51 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/pynacl/default.nix b/pkgs/development/python-modules/pynacl/default.nix
index c23a90c095b..981427e46f3 100644
--- a/pkgs/development/python-modules/pynacl/default.nix
+++ b/pkgs/development/python-modules/pynacl/default.nix
@@ -11,11 +11,8 @@ buildPythonPackage rec {
     sha256 = "0z9i1z4hjzmp23igyhvg131gikbrr947506lwfb3fayf0agwfv8f";
   };
 
-  #remove deadline from tests, see https://github.com/pyca/pynacl/issues/370
-  preCheck = ''
-    sed -i 's/deadline=1500, //' tests/test_pwhash.py
-    sed -i 's/deadline=1500, //' tests/test_aead.py
-  '';
+  #set timeout to unlimited, remove deadline from tests, see https://github.com/pyca/pynacl/issues/370
+  patches = [ ./pynacl-no-timeout-and-deadline.patch ];
 
   checkInputs = [ pytest coverage hypothesis ];
   propagatedBuildInputs = [ libsodium cffi six ];
diff --git a/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch b/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch
new file mode 100644
index 00000000000..5f831df3c48
--- /dev/null
+++ b/pkgs/development/python-modules/pynacl/pynacl-no-timeout-and-deadline.patch
@@ -0,0 +1,49 @@
+diff --git a/tests/test_pwhash.py b/tests/test_pwhash.py
+index 9634c85..7f20316 100644
+--- a/tests/test_pwhash.py
++++ b/tests/test_pwhash.py
+@@ -20,7 +20,7 @@ import os
+ import sys
+ import unicodedata as ud
+ 
+-from hypothesis import given, settings
++from hypothesis import given, settings, unlimited
+ from hypothesis.strategies import integers, text
+ 
+ import pytest
+@@ -411,7 +411,7 @@ def test_str_verify_argon2_ref_fail(password_hash, password):
+        integers(min_value=1024 * 1024,
+                 max_value=16 * 1024 * 1024)
+        )
+-@settings(deadline=1500, max_examples=20)
++@settings(timeout=unlimited, 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)
+@@ -425,7 +425,7 @@ def test_argon2i_str_and_verify(password, ops, mem):
+        integers(min_value=1024 * 1024,
+                 max_value=16 * 1024 * 1024)
+        )
+-@settings(deadline=1500, max_examples=20)
++@settings(timeout=unlimited, 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)
+@@ -439,7 +439,7 @@ def test_argon2id_str_and_verify(password, ops, mem):
+        integers(min_value=1024 * 1024,
+                 max_value=16 * 1024 * 1024)
+        )
+-@settings(deadline=1500, max_examples=20)
++@settings(timeout=unlimited, 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)
+@@ -448,7 +448,7 @@ def test_argon2i_str_and_verify_fail(password, ops, mem):
+ 
+ 
+ @given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20))
+-@settings(deadline=1500, max_examples=5)
++@settings(timeout=unlimited, deadline=None, max_examples=5)
+ def test_pwhash_str_and_verify(password):
+     _psw = password.encode('utf-8')
+