-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
enable warnings to notify the users about the deprecated features #1668
Milestone
Comments
I spoke with @hpk42 and I will implement a new flag |
This was referenced Aug 24, 2016
This was referenced Aug 31, 2016
This was referenced Nov 15, 2017
Merged
This was referenced Nov 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently when a pytest warning appears, the users only see a notification like below
================= 1 pytest-warnings, 4 error in 0.12 seconds ==================
(do not confuse this one with the python warnings mechanism).
This happens when, for example, there's a pytest hook which relies on the
__multicall__
.If one wants to see what causes the warning, an additional
-r w
flag has to be added to the commandline, or a corresponding ini file option has to be set. Example warnings summary:=========================== pytest-warning summary ============================ WI1 <path>/conftest.py:92 'pytest_runtest_call' hook uses deprecated __multicall__ argument ================= 1 pytest-warnings, 4 error in 0.06 seconds ==================
It was agreed that the warnings summary should be displayed by default.
What would be the way to go now?
-r
flag to takew
as a default. However, the default value is overwritten when specifying-r XYZ
- or whatever else is then on the actual commandline call. The commandline flag will be taken instead of the default. Not an option, I guess, since many users already use the-r
flag. The notification wouldn't simply go through.getreportopt()
function in the_pytest.terminal
and append thereportchars
variable withw
permanently. The question is here: how would then users silence the warnings if the wish to? Another flag, something like--set-report-chars
could be introduced which would override the-r
, but the plan is to limit the number of commandline options. Limiting the commandline options idea contradicts to adding a--disable-pytest-warnings
flag.Would this pull request allow overriding the appended of the
w
if option 2 is selected?Or maybe you have a better idea how to enable the pytest warnings summary in another way?
Keep in mind that users should be still able to silence them.
The text was updated successfully, but these errors were encountered: