Repository: HypothesisWorks/hypothesis

Issue:
Inexplicable test failures on 3.13.0+
I have a test that looks something like this:
```python
@given(s.data(), fs.finapps(store))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test(data, finapp):
    pass
```
On Hypothesis 3.12.0 this works fine. On Hypothesis 3.13.0, every example is rejected, eventually hitting the timeout (if I turn up the verbosity, I see "Run complete after 288 examples (0 valid) and 0 shrinks").

However, if I change it to this, which seems like it should be identical, then the test works fine on both versions of Hypothesis:
```python
@given(s.data())
@settings(suppress_health_check=[HealthCheck.too_slow])
def test(data):
    finapp = data.draw(fs.finapps(store))
```

Unfortunately this codebase is proprietary, and `fs.finapps` is a pretty complex strategy, so I'm not sure exactly where to start tracking this down, and I haven't had any luck constructing a minimal reproducer yet.


Discussion:
We certainly consider it a bug when public APIs stop working, but I don't think we can help much without knowing more about the strategy in question or a reproducible example - minimal is preferred but not absolutely required.

I suspect that @DRMacIver might also be able to help out 'for a modest fee' if that would help with the legal side of things.
Success! Once I realised that most of the code involved in my test was actually irrelevant, I was able to cut it down to something pretty small. Here's a self-contained example:
```python
from hypothesis import strategies as s, given

def strat():
    return s.builds(dict, one=strat_one())

@s.composite
def strat_one(draw):
    return draw(s.builds(dict, val=s.builds(dict, two=strat_two())))

@s.composite
def strat_two(draw):
    return draw(s.builds(dict, some_text=s.text(min_size=1)))

@given(strat())
def test(v):
    pass

test()
```
This passes instantly on Hypothesis 3.12.0, and hits the timeout on 3.13.0 and 3.14.0 with zero examples found.

Resolving patch:
diff --git a/src/hypothesis/internal/conjecture/data.py b/src/hypothesis/internal/conjecture/data.py
--- a/src/hypothesis/internal/conjecture/data.py
+++ b/src/hypothesis/internal/conjecture/data.py
@@ -45,7 +45,7 @@ def __init__(self, testcounter):
 global_test_counter = 0
 
 
-MAX_DEPTH = 50
+MAX_DEPTH = 100
 
 
 class ConjectureData(object):
diff --git a/src/hypothesis/version.py b/src/hypothesis/version.py
--- a/src/hypothesis/version.py
+++ b/src/hypothesis/version.py
@@ -17,5 +17,5 @@
 
 from __future__ import division, print_function, absolute_import
 
-__version_info__ = (3, 14, 0)
+__version_info__ = (3, 14, 1)
 __version__ = '.'.join(map(str, __version_info__))


Test patch:
diff --git a/tests/cover/test_regressions.py b/tests/cover/test_regressions.py
new file mode 100644
--- /dev/null
+++ b/tests/cover/test_regressions.py
@@ -0,0 +1,57 @@
+# coding=utf-8
+#
+# This file is part of Hypothesis, which may be found at
+# https://github.com/HypothesisWorks/hypothesis-python
+#
+# Most of this work is copyright (C) 2013-2017 David R. MacIver
+# (david@drmaciver.com), but it contains contributions by others. See
+# CONTRIBUTING.rst for a full list of people who may hold copyright, and
+# consult the git log if you need to determine who owns an individual
+# contribution.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at http://mozilla.org/MPL/2.0/.
+#
+# END HEADER
+
+from __future__ import division, print_function, absolute_import
+
+import pytest
+
+from hypothesis import strategies as st
+from hypothesis import Verbosity, given, settings
+
+
+def strat():
+    return st.builds(dict, one=strat_one())
+
+
+@st.composite
+def strat_one(draw):
+    return draw(st.builds(dict, val=st.builds(dict, two=strat_two())))
+
+
+@st.composite
+def strat_two(draw):
+    return draw(st.builds(dict, some_text=st.text(min_size=1)))
+
+
+@given(strat())
+def test_issue751(v):
+    pass
+
+
+def test_can_find_non_zero():
+    # This future proofs against a possible failure mode where the depth bound
+    # is triggered but we've fixed the behaviour of min_size so that it can
+    # handle that: We want to make sure that we're really not depth bounding
+    # the text in the leaf nodes.
+
+    @settings(verbosity=Verbosity.quiet)
+    @given(strat())
+    def test(v):
+        assert '0' in v['one']['val']['two']['some_text']
+
+    with pytest.raises(AssertionError):
+        test()