-
Notifications
You must be signed in to change notification settings - Fork 121
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
Skip logging when benchmark is disabled #199
Comments
I would like to see what addopts you have in pytest.ini/tox.ini/setup.cfg. |
Of course I should have already provided this. Here are all of my pytest options in my [tool.pytest]
[tool.pytest.ini_options]
minversion = '6.2'
cache_dir = '.cache/pytest'
addopts = '''
-x
--strict-markers
--benchmark-disable
--benchmark-storage=.cache/benchmarks
--benchmark-autosave
--benchmark-compare
--benchmark-group-by=name,fullname
'''
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
norecursedirs = '''
docs/_build
docs/examples
'''
doctest_optionflags = 'ELLIPSIS NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL' I also use poetry, so with these I actually call pytest with |
I am looking for an option to disable the report completely or at least when the test is passing but I was not able to find any option to do that. Note that I do not want to disable the benchmarking, but I want to display nothing it it does pass. I already added code to fail the benchmarked test if it takes too much time. Any hints? thanks. I can give an example where coverage module has an option |
I have a library where I normally disable the benchmarks and only run them when editing certain files. However, I still get the warning log messages from
pytest-benchmark
in this case. Can we disable logging when the benchmarks are disabled?Another question - the last log message is always displayed on the same line as the last test for me. See the
[100%]/home...
. pytest apparently doesn't include a final newline there. Is there an easy way to avoid this so that the log message goes to the next line?The text was updated successfully, but these errors were encountered: