-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Yield test deprecation warning spams too much #2562
Comments
Agreed on issuing the warning only once per generator. To suppress those warnings you can add this to your [pytest]
filterwarnings =
ignore:.*yield tests are deprecated.* |
@nicoddemus: adding that to pytest.ini doesn't silence these warnings
for me, in the example case given above.
|
Hmm yeah I didn't test it, sorry. Those parameters are passed to |
This deprecation warning seems to be emitted at _pytest/python.py:618 directly by |
Oh you are right, sorry about that. Indeed we would have to change it to raise an actual warning. |
xref: #1043 |
I'll submit a pull request removing the four spaces in a moment :) |
Fixed in #2563 |
While working on scipy/scipy#7572 I noticed that pytest emits the "yield tests are deprecated, and scheduled to be removed in pytest 4.0" warning for each generated test, not per each test generator. (And for scipy, this means the message is printed 15652 times :) -- of course we'll eventually plan to refactor them completely away, but that takes some time.)
There are workarounds such as
--disable-warnings
and tagging| uniq
to the end, but it would be nice if this was fixed to be less spammy on the pytest end.As far as I understand, there's no way to disable this deprecation warning in
pytest.ini
without also disabling the whole warning capture mechanism (which is what--disable-pytest-warnings
et al seem to do)?Minimal repro:
The text was updated successfully, but these errors were encountered: