-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
MAINT: Ignore pytest's PytestConfigWarning #12913
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
MAINT: Ignore pytest's PytestConfigWarning #12913
Conversation
I expect we'll see some failures in the same Travis CI run that had been failing because of the PytestConfigWarning. Locally, when I run the
|
When pytest is run with python optimization set by the environment variable PYTHONOPTIMIZE=2, it generates the warning pytest.PytestConfigWarning: assertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter (are you using python -O?) Apparently this warning causes the test suite to fail. In this change, I've added ignore:assertions not in test modules or plugins:pytest.PytestConfigWarning to the filter warnings used by pytest, so the PytestConfigWarning is ignored.
d6ba3c3
to
37abaa9
Compare
It turns out all the tests on Travis CI now pass, so I guess there is some other difference between the Travis CI environment and my local setup. Given that, I think we can consider merging this change to get all the CI tests back to passing. |
CI's green again, so lets get it in. Thanks @WarrenWeckesser. |
Marked as backport candidate as I assume maintenance branches will get the same failures. |
When pytest is run with python optimization set by the environment variable
PYTHONOPTIMIZE=2, it generates the warning
Apparently this warning causes the test suite to fail. In this change,
I've added
to the filter warnings used by pytest, so the PytestConfigWarning is
ignored.