Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved hypothesis outputs #605

Merged
merged 4 commits into from
Jun 4, 2020
Merged

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

Improve output for hypothesis tests.

Related to #567

How I did it

  1. Hypothesis has it's own version of __tracebackhide__ called __hypothesistracebackhide__ that gets applied to each brownie module to reduce the length of tracebacks.
  2. Alter the hypothesis reports to include highlights and reduce file paths. This applies to "regular" hypothesis output - that of a @given based test which is shown in a === hypothesis === report.
  3. Replace the default hypothesis reporter with a custom one that applies the same formatting as the previous step. This is a requirement for stateful test output, because it gets sent to stdout rather than being displayed as a report.
  4. Move report_multiple_bugs to the config file so that it can be set by users. I've left it as False by default, because I feel the additional context provided by pytest's traceback rewrites is valuable enough to make it worth running a test twice. I've also added a note to the documentation about the existence of this setting and what it does.

How to verify it

Run some hypothesis tests, make them fail. This is venturing into an area where it's pretty difficult to effectively test 😬

Copy link
Collaborator

@matnad matnad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@iamdefinitelyahuman iamdefinitelyahuman merged commit f672c18 into master Jun 4, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-hypothesis-outputs branch June 4, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants