@@ -97,7 +97,7 @@ def __init__(
9797 while 2 ** (len (strategies ) - 1 ) <= max_leaves :
9898 strategies .append (extend (OneOfStrategy (tuple (strategies ))))
9999 # If min_leaves > 1, we can never draw from base directly
100- if isinstance ( min_leaves , int ) and min_leaves > 1 :
100+ if min_leaves is not None and min_leaves > 1 :
101101 strategies = strategies [1 :]
102102 self .strategy = OneOfStrategy (strategies )
103103
@@ -116,13 +116,15 @@ def do_validate(self) -> None:
116116 check_strategy (extended , f"extend({ self .limited_base !r} )" )
117117 self .limited_base .validate ()
118118 extended .validate ()
119+
119120 if is_identity_function (self .extend ):
120121 warnings .warn (
121122 "extend=lambda x: x is a no-op; you probably want to use a "
122123 "different extend function, or just use the base strategy directly." ,
123124 HypothesisWarning ,
124125 stacklevel = 5 ,
125126 )
127+
126128 if not is_first_param_referenced_in_function (self .extend ):
127129 msg = (
128130 f"extend={ get_pretty_function_description (self .extend )} doesn't use "
@@ -137,6 +139,7 @@ def do_validate(self) -> None:
137139 )
138140 else :
139141 raise InvalidArgument (msg )
142+
140143 if self .min_leaves is not None :
141144 check_type (int , self .min_leaves , "min_leaves" )
142145 check_type (int , self .max_leaves , "max_leaves" )
0 commit comments