-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
pytest-warnings fails tests since 2.8 #1045
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
Comments
You mean the test suite is failing (returning != 0 to the system)? This shouldn't happen and is certainly a bug if it is.
I get the feeling that you are talking about about the
Can you give more information on this, traceback, running with |
My bad, I just checked the exit codes and they're fine (win/linux). My specific problem was actually caused by the exit code being 5 when no tests are found. Coincidentally, it was the first time I saw the pytest-warnings message and assumed it was failing the exit code check. Adding the -rx switch doesn't show any additional information to the run, although pytest still mentions the 2 pytest-warnings at the end of the run...
|
Oh sorry, I meant |
Oh I see. There was a debate over this, but the vast majority of people voted on having this behavior, as many felt they should get a failure if no tests were even collected ( |
It's a nice behavior ;) Although. if it's returning anything else than 0, it should probably state it clearly a the end of the run? Thanks for the -rw trick, wish that was easier to google.
|
No problem, I'm closing this then. 😄 |
The non-zero exit code is causing pytest-watch to indicate spurious failure when used with pytest-testmon or pytest-incremental. When either of those tools determines there're no tests to be run, pytest-watch reports a failure. |
@nitishr |
I'm glad there is a non-zero exitcode when no tests are collected -- exiting zero never seemed right to me -- but I'm seeing a exitcode of 5 even when tests have been collected. Should I open a new issue, or is this related to a non-zero number of tests being skipped?
|
@mdengler it should return zero if tests were collected, regardless if they were skipped or not: import pytest
@pytest.mark.skipif('True')
def test_foo():
assert 0
If you are getting something else, please open a new issue. 😄 |
Something changed in 2.8 that makes all my test runs fail with "2 pytest-warnings". I had to use a simplefilter to even be able to view what the warnings were about.
One of the failure is a simple deprecationwarning that I can live with for the time being. It's not clear how we're supposed to disable this functionality - tried all possible warnings.simplefilter values and the only useful one seems to be "error" (that's how I could see what the warning was all about).
Another warning is now seen as a pytest-warnings that fails my test. It's an ImportWarning because of a duplicate folder name (one with init, one without). Python correctly resolves the init one.
I'll be pinning 2.7.3 until this is fixed.
The text was updated successfully, but these errors were encountered: