tests: pass settings of hypothesis by with statement
authorYuya Nishihara <yuya@tcha.org>
Tue, 26 Jan 2016 23:05:19 +0900
changeset 27999 b30b40804a3f
parent 27998 84513a4fcc3a
child 28000 d4247c306d82
tests: pass settings of hypothesis by with statement given(..., settings=) is no longer available in Hypothesis 2.0.0. https://github.com/DRMacIver/hypothesis/commit/7712c01
tests/hypothesishelpers.py
--- a/tests/hypothesishelpers.py	Tue Jan 26 22:44:29 2016 +0900
+++ b/tests/hypothesishelpers.py	Tue Jan 26 23:05:19 2016 +0900
@@ -33,7 +33,8 @@
         # Fixed in version 1.13 (released 2015 october 29th)
         f.__module__ = '__anon__'
         try:
-            given(*args, settings=settings(max_examples=2000), **kwargs)(f)()
+            with settings(max_examples=2000):
+                given(*args, **kwargs)(f)()
         except Exception:
             traceback.print_exc(file=sys.stdout)
             sys.exit(1)