tests/hypothesishelpers.py
changeset 27999 b30b40804a3f
parent 27998 84513a4fcc3a
child 28727 f33280667aa5
equal deleted inserted replaced
27998:84513a4fcc3a 27999:b30b40804a3f
    31     def accept(f):
    31     def accept(f):
    32         # Workaround for https://github.com/DRMacIver/hypothesis/issues/206
    32         # Workaround for https://github.com/DRMacIver/hypothesis/issues/206
    33         # Fixed in version 1.13 (released 2015 october 29th)
    33         # Fixed in version 1.13 (released 2015 october 29th)
    34         f.__module__ = '__anon__'
    34         f.__module__ = '__anon__'
    35         try:
    35         try:
    36             given(*args, settings=settings(max_examples=2000), **kwargs)(f)()
    36             with settings(max_examples=2000):
       
    37                 given(*args, **kwargs)(f)()
    37         except Exception:
    38         except Exception:
    38             traceback.print_exc(file=sys.stdout)
    39             traceback.print_exc(file=sys.stdout)
    39             sys.exit(1)
    40             sys.exit(1)
    40     return accept
    41     return accept
    41 
    42