Skip to content

Rename internal "warnings" in the terminal output to "pytest-warnings" #970

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

Closed
nicoddemus opened this issue Aug 27, 2015 · 11 comments
Closed
Labels
topic: reporting related to terminal output and user-facing messages and errors

Comments

@nicoddemus
Copy link
Member

Currently when the a suite contains internal warnings (such as classes starting with "Test" but containing a __init__ method) produce output like this:

=== 50 passed, 2 warnings in 24.72 seconds ===

In my experience, this is confusing for most users when they first see this, as they think the test suite is producing warnings from the builtin warnings module.

How about if we rename "warnings" to "pytest-warnings"?

=== 50 passed, 2 pytest-warnings in 24.72 seconds ===

I think most users will immediately understand that the warnings are related to pytest, and not from their code.

@nicoddemus nicoddemus added the topic: reporting related to terminal output and user-facing messages and errors label Aug 27, 2015
@RonnyPfannschmidt
Copy link
Member

👍

@The-Compiler
Copy link
Member

FWIW, 👍 from me as well

@alfredodeza
Copy link
Contributor

I came here trying to find about "pytest-warnings" which were throwing me off. I've never seen those and something like a one line saying: "N pytest-warnings found, to get a report use $flags"

@bhearsum
Copy link

For what it's worth, "pytest-warnings" doesn't help make this more obvious for me. I'm running my own unit tests, so when I see something that says "warning" and turns yellow, I immediately blame my code. I think it would be really helpful if anything that caused an internal warning or error provided some output by default. After passing -rw I end up with a message like:
WI9 None could not create cache path /home/bhearsum/repos/master/balrog/.cache/v/cache/lastfailed

...which makes it immediately obvious that it's not an issue with my code.

@nicoddemus
Copy link
Member Author

@bhearsum I agree... I'm thinking that ideally pytest-warnings should only be shown if they were generated by the code under test. It is not helpful at all to display pytest-warnings for plugins (for example), as this is outside the user's control.

@njsmith
Copy link

njsmith commented May 5, 2016

I also ended up here after spending a few baffled minutes trying to figure out why my results were yellow and trying every mechanism I knew for coaxing more output out of pytest (-v, -s, etc.), all of which failed.

@ssbarnea
Copy link
Member

ssbarnea commented Aug 1, 2016

Any plans to fix this annoying issue? I really hate adding confusion to anyone that is trying to read the logs.

@RonnyPfannschmidt
Copy link
Member

@ssbarnea this is fixed since last year and is released since a while

@ssbarnea
Copy link
Member

ssbarnea commented Aug 1, 2016

I am using the latest version pytest and I do still see these warnings which are confusing. I guess we are talking about different issues.

My issue is that I see 1 pytest-warnings inside the logs and that I have no idea what they mean or what to do about them.

I just don't want to have non-actionable warnings in the build logs because they are toxic.

============================================================================================== test session starts ==============================================================================================
platform darwin -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /Users/sorins/bmll/bmll-template, inifile: setup.cfg
plugins: timeout-1.0.0, cov-2.3.0, asyncio-0.3.0
------------------
================================================================================== 1 passed, 1 pytest-warnings in 0.07 seconds ==================================================================================

@nicoddemus
Copy link
Member Author

@ssbarnea in pytest-3.0 now the warnings are displayed by default.

@The-Compiler
Copy link
Member

@ssbarnea Note that you can pass -rw to pytest (< 3.0) to show the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors
Projects
None yet
Development

No branches or pull requests

7 participants