##// END OF EJS Templates
tests: adjust for code move in Hypothesis 2.0.0...
Yuya Nishihara -
r27998:84513a4f default
parent child Browse files
Show More
@@ -8,9 +8,16 b' import os'
8 import sys
8 import sys
9 import traceback
9 import traceback
10
10
11 from hypothesis.settings import set_hypothesis_home_dir
11 try:
12 # hypothesis 2.x
13 from hypothesis.configuration import set_hypothesis_home_dir
14 from hypothesis import settings
15 except ImportError:
16 # hypothesis 1.x
17 from hypothesis.settings import set_hypothesis_home_dir
18 from hypothesis import Settings as settings
12 import hypothesis.strategies as st
19 import hypothesis.strategies as st
13 from hypothesis import given, Settings
20 from hypothesis import given
14
21
15 # hypothesis store data regarding generate example and code
22 # hypothesis store data regarding generate example and code
16 set_hypothesis_home_dir(os.path.join(
23 set_hypothesis_home_dir(os.path.join(
@@ -26,7 +33,7 b' def check(*args, **kwargs):'
26 # Fixed in version 1.13 (released 2015 october 29th)
33 # Fixed in version 1.13 (released 2015 october 29th)
27 f.__module__ = '__anon__'
34 f.__module__ = '__anon__'
28 try:
35 try:
29 given(*args, settings=Settings(max_examples=2000), **kwargs)(f)()
36 given(*args, settings=settings(max_examples=2000), **kwargs)(f)()
30 except Exception:
37 except Exception:
31 traceback.print_exc(file=sys.stdout)
38 traceback.print_exc(file=sys.stdout)
32 sys.exit(1)
39 sys.exit(1)
General Comments 0
You need to be logged in to leave comments. Login now