You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Checks that value is either unspecified, or a valid non-negative size
expressed as an integer/float.
Otherwise raises InvalidArgument.
"""
ifvalueisNone:
return
check_type(integer_types+ (float,), value)
Sizes - the number of elements in a collection, bounded by min_size and max_size arguments, should always be integers. However, we currently also accept floats for these arguments! We should replace the check_type(integer_types + (float,), value) with
And then write a test in hypothesis-python/tests/cover/test_validation.py that uses @checks_deprecated_behaviour, passes max_size=5.0 to lists(), and checks that the resulting lists are at most five elements long.
Finally, we should update the type hints for average_size arguments to # type: None as None is the only non-deprecated value.
The text was updated successfully, but these errors were encountered:
hypothesis/hypothesis-python/src/hypothesis/internal/validation.py
Lines 102 to 111 in 859069c
Sizes - the number of elements in a collection, bounded by
min_size
andmax_size
arguments, should always be integers. However, we currently also accept floats for these arguments! We should replace thecheck_type(integer_types + (float,), value)
withAnd then write a test in
hypothesis-python/tests/cover/test_validation.py
that uses@checks_deprecated_behaviour
, passesmax_size=5.0
tolists()
, and checks that the resulting lists are at most five elements long.Finally, we should update the type hints for
average_size
arguments to# type: None
asNone
is the only non-deprecated value.The text was updated successfully, but these errors were encountered: