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
Are there any strong opposition to allowing non-strategy objects in st.builds() positional and keyword arguments to be handled as exact values (i.e., as if it was passed in with st.just()?
@given(st.builds(MyClass, x==st.integers(), y="foobar"))deftest():
...
# Currently causes:# InvalidArgument: Expected a SearchStrategy but got mapping['y']='foobar' (type=str)
The text was updated successfully, but these errors were encountered:
Yes - it complicates the interface, which is a cost that grows surprisingly quickly and is disproportionately bad for complicated use-cases.
The current workarounds with just() or functools.partial() also seem fine to me, and I think that since these are necessary tools for complex use-cases there's some value in making them the idiomatic solution in simple cases too.
Well it's a UX consideration—I can never use hypothesis without constantly going referring back to What you can generate and how. Even so what keyword do I search for to figure out it's st.just().
Are there any strong opposition to allowing non-strategy objects in
st.builds()
positional and keyword arguments to be handled as exact values (i.e., as if it was passed in withst.just()
?Current Behavior
Desired Behavior
The text was updated successfully, but these errors were encountered: