Skip to content

Commit

Permalink
This is reachable after all
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Sep 30, 2023
1 parent d755b28 commit d58adf8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RELEASE_TYPE: patch

Fixes :issue:`3755`, where an internal condition turns out
to be reachable after all.
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,6 @@ def explain(self):

if result.status == Status.OVERRUN:
continue # pragma: no cover # flakily covered

if not (
len(buf_attempt_fixed) == len(result.buffer)
and result.buffer.endswith(buffer[end:])
): # pragma: no cover
raise NotImplementedError("This should never happen")
else:
chunks[(start, end)].append(result.buffer[start:end])

Expand Down
10 changes: 10 additions & 0 deletions hypothesis-python/tests/conjecture/test_inquisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

from hypothesis import given, settings, strategies as st

from tests.common.utils import fails_with


def fails_with_output(expected, error=AssertionError, **kw):
def _inner(f):
Expand Down Expand Up @@ -70,3 +72,11 @@ def test_inquisitor_comments_basic_fail_if_not_all(a, b, c):
@given(st.text(), st.text())
def test_inquisitor_no_together_comment_if_single_argument(a, b):
assert a


@fails_with(ZeroDivisionError)
@settings(database=None)
@given(start_date=st.datetimes(), data=st.data())
def test_issue_3755_regression(start_date, data):
data.draw(st.datetimes(min_value=start_date))
raise ZeroDivisionError

0 comments on commit d58adf8

Please sign in to comment.