Skip to content

Commit

Permalink
Print explicit examples in verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Jun 16, 2017
1 parent 104193b commit 3c27d7f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/changes.rst
Expand Up @@ -21,6 +21,13 @@ Hypothesis APIs come in three flavours:
You should generally assume that an API is internal unless you have specific
information to the contrary.

-------------------
3.11.4 - 2017-06-17
-------------------

This is a bugfix release: Hypothesis now prints explicit examples when
running in verbose mode. (:issue:`313`)

-------------------
3.11.3 - 2017-06-11
-------------------
Expand Down
6 changes: 4 additions & 2 deletions src/hypothesis/core.py
Expand Up @@ -226,18 +226,20 @@ def execute_explicit_examples(
# Note: Test may mutate arguments and we can't rerun explicit
# examples, so we have to calculate the failure message at this
# point rather than than later.
message_on_failure = 'Falsifying example: %s(%s)' % (
example_string = '%s(%s)' % (
test.__name__, arg_string(test, arguments, example_kwargs)
)
try:
with BuildContext(None) as b:
if current_verbosity() >= Verbosity.verbose:
report(lambda: 'Trying example: %s' % example_string)
test_runner(
None,
lambda data: test(*arguments, **example_kwargs)
)
except BaseException:
traceback.print_exc()
report(message_on_failure)
report('Falsifying example: %s' % example_string)
for n in b.notes:
report(n)
raise
Expand Down
2 changes: 1 addition & 1 deletion src/hypothesis/version.py
Expand Up @@ -17,5 +17,5 @@

from __future__ import division, print_function, absolute_import

__version_info__ = (3, 11, 3)
__version_info__ = (3, 11, 4)
__version__ = '.'.join(map(str, __version_info__))

0 comments on commit 3c27d7f

Please sign in to comment.