@@ -304,7 +304,6 @@ def _define_setting(
304
304
future_default = not_set ,
305
305
deprecation_message = None ,
306
306
deprecated_since = None ,
307
- hide_repr = not_set ,
308
307
):
309
308
"""Add a new setting.
310
309
@@ -326,9 +325,6 @@ def _define_setting(
326
325
if future_default is not_set :
327
326
future_default = default
328
327
329
- if hide_repr is not_set :
330
- hide_repr = bool (deprecation_message )
331
-
332
328
all_settings [name ] = Setting (
333
329
name = name ,
334
330
description = description .strip (),
@@ -338,7 +334,6 @@ def _define_setting(
338
334
future_default = future_default ,
339
335
deprecation_message = deprecation_message ,
340
336
deprecated_since = deprecated_since ,
341
- hide_repr = hide_repr ,
342
337
)
343
338
setattr (settings , name , settingsProperty (name , show_default ))
344
339
@@ -372,7 +367,7 @@ def __repr__(self):
372
367
value = getattr (self , name )
373
368
# The only settings that are not shown are those that are
374
369
# deprecated and left at their default values.
375
- if value != setting .default or not setting .hide_repr :
370
+ if value != setting .default or not setting .deprecation_message :
376
371
bits .append ("%s=%r" % (name , value ))
377
372
return "settings(%s)" % ", " .join (sorted (bits ))
378
373
@@ -473,7 +468,6 @@ class Setting(object):
473
468
future_default = attr .ib ()
474
469
deprecation_message = attr .ib ()
475
470
deprecated_since = attr .ib ()
476
- hide_repr = attr .ib ()
477
471
478
472
479
473
settings ._define_setting (
@@ -539,31 +533,17 @@ class Setting(object):
539
533
540
534
541
535
def _validate_timeout (n ):
542
- if n is unlimited :
543
- return - 1
544
- else :
536
+ if n in (not_set , unlimited ):
545
537
return n
538
+ raise InvalidArgument ("The timeout setting has been removed." )
546
539
547
540
548
541
settings ._define_setting (
549
542
"timeout" ,
550
- default = 60 ,
551
- description = """
552
- Once this many seconds have passed, falsify will terminate even
553
- if it has not found many examples. This is a soft rather than a hard
554
- limit - Hypothesis won't e.g. interrupt execution of the called
555
- function to stop it. If this value is <= 0 then no timeout will be
556
- applied.
557
- """ ,
558
- hide_repr = False , # Still affects behaviour at runtime
559
- deprecation_message = """
560
- The timeout setting is deprecated and will be removed in a future version of
561
- Hypothesis. To get the future behaviour set ``timeout=hypothesis.unlimited``
562
- instead (which will remain valid for a further deprecation period after this
563
- setting has gone away).
564
- """ ,
543
+ default = not_set ,
544
+ description = "The timeout setting has been deprecated and no longer does anything." ,
545
+ deprecation_message = "The timeout setting can safely be removed with no effect." ,
565
546
deprecated_since = "2017-11-02" ,
566
- future_default = unlimited ,
567
547
validator = _validate_timeout ,
568
548
)
569
549
0 commit comments