Skip to content

Commit

Permalink
This code is in fact covered
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Apr 30, 2022
1 parent 5d47cb0 commit f523ae5
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions hypothesis-python/src/hypothesis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,27 +868,20 @@ def run_engine(self):
tb = get_trimmed_traceback()
report(format_exception(e, tb))

finally: # pragma: no cover
# Mostly useful for ``find`` and ensuring that objects that
# hold on to a reference to ``data`` know that it's now been
# finished and they shouldn't attempt to draw more data from
# it.
ran_example.freeze()

# This section is in fact entirely covered by the tests in
# test_reproduce_failure, but it seems to trigger a lovely set
# of coverage bugs: The branches show up as uncovered (despite
# definitely being covered - you can add an assert False else
# branch to verify this and see it fail - and additionally the
# second branch still complains about lack of coverage even if
# you add a pragma: no cover to it!
# See https://github.com/nedbat/coveragepy/issues/623
finally:
# Whether or not replay actually raised the exception again, we want
# to print the reproduce_failure decorator for the failing example.
if self.settings.print_blob:
report(
"\nYou can reproduce this example by temporarily adding "
"@reproduce_failure(%r, %r) as a decorator on your test case"
% (__version__, encode_failure(falsifying_example.buffer))
)
# Mostly useful for ``find`` and ensuring that objects that
# hold on to a reference to ``data`` know that it's now been
# finished and they can't draw more data from it.
ran_example.freeze()

if self.__was_flaky:
flaky += 1

Expand Down

0 comments on commit f523ae5

Please sign in to comment.