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

Config option to skip pytest_report_header #2155

Closed
blueyed opened this issue Oct 28, 2019 · 5 comments · Fixed by #2165
Closed

Config option to skip pytest_report_header #2155

blueyed opened this issue Oct 28, 2019 · 5 comments · Fixed by #2165
Labels
enhancement it's not broken, but we want it to be better

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 28, 2019

With pytest's tests I am seeing the following line all the time.
I think it would be nice if it could be disabled (made quiet):

hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/user/Vcs/pytest/.hypothesis/examples')

There's --hypothesis-verbosity already, but it appears to have a different purpose?

I think a config/ini option would be good (instead of a cli argument/param).

@Zac-HD Zac-HD added the enhancement it's not broken, but we want it to be better label Oct 29, 2019
@Zac-HD
Copy link
Member

Zac-HD commented Oct 29, 2019

Hmm, maybe we could have it disabled by default, but show it if either the pytest or Hypothesis verbosity was set at above default?

def pytest_report_header(config):
profile = config.getoption(LOAD_PROFILE_OPTION)
if not profile:
profile = settings._current_profile
settings_str = settings.get_profile(profile).show_changed()
if settings_str != "":
settings_str = " -> %s" % (settings_str)
return "hypothesis profile %r%s" % (profile, settings_str)

@blueyed
Copy link
Contributor Author

blueyed commented Oct 29, 2019

That would be a good start / compromise I think.
Could use "verbosity > 1", i.e. with -vv then only maybe.
(Note that I'm not sure how useful that information is in general, and would not have hypothesis installed by default in pytest probably, since it does not appear to get used still really)

Ref: pytest-dev/pytest#4977 (comment)

@blueyed
Copy link
Contributor Author

blueyed commented Nov 2, 2019

Thanks!

@Zac-HD
Copy link
Member

Zac-HD commented Nov 2, 2019

No problem!

@Zac-HD
Copy link
Member

Zac-HD commented Nov 2, 2019

While I'm thinking about it actually, do you know of a way to check whether a test uses specifically function-scoped fixtures? We'd like to emit a warning for that from our pytest plugin; more in #377.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants