Nesting @given() inside @given() might seem reasonable at first glance - but there are major problems, and it doesn't actually give you any more power than using st.data() instead of an inner function. Those downsides include quadratic cost of generating examples, and considerably worse when shrinking; and outright incompatibility with some alternative backends.
So let's detect this, emit a deprecation warning - which can explain how and why to use st.data() instead - and then we'll turn that into an error in the next major version.
Nesting
@given()
inside@given()
might seem reasonable at first glance - but there are major problems, and it doesn't actually give you any more power than usingst.data()
instead of an inner function. Those downsides include quadratic cost of generating examples, and considerably worse when shrinking; and outright incompatibility with some alternative backends.@tybug checked a github dataset, and there are only five cases across thousands of repos: one in each of ArielHorwitz/botroyale, chardet/chardet, and cgarciae/pypeln, and vyperlang/vyper has these two.
So let's detect this, emit a deprecation warning - which can explain how and why to use
st.data()
instead - and then we'll turn that into an error in the next major version.