Skip to content
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

Can't filter rewrite warnings #4439

Closed
shaicantor opened this issue Nov 22, 2018 · 3 comments
Closed

Can't filter rewrite warnings #4439

shaicantor opened this issue Nov 22, 2018 · 3 comments
Labels
plugin: warnings related to the warnings builtin plugin plugin: xdist related to the xdist external plugin type: bug problem that needs to be addressed

Comments

@shaicantor
Copy link

Hi,

Part of my code imports the xdist plugin.
As a result I receive

================================================ warnings summary ================================================
/path/to/my/ve/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:268: PytestWarning: Module already imported so cannot be rewritten: xdist
  self.config,
/path/to/my/ve/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:268: PytestWarning: Module already imported so cannot be rewritten: xdist
  self.config,

-- Docs: https://docs.pytest.org/en/latest/warnings.html

I tried filtering with:

  1. -p no:warnings -> no luck
  2. --disable-pytest-warnings -> removes the warning but the summary is still yellow
  3. @pytest.mark.filterwarnings -> no luck
  4. native python warning.filterwarnings -> no luck

How can I filter this specific warning???

pytest version - 3.8.2

@nicoddemus
Copy link
Member

Hi @shaicantor, thanks for writing up, looks like a bug.

@nicoddemus nicoddemus added type: bug problem that needs to be addressed plugin: warnings related to the warnings builtin plugin labels Nov 22, 2018
@blueyed
Copy link
Contributor

blueyed commented Nov 22, 2018

btw (maybe necessary here also): pytest-dev/pytest-cov#228

@nicoddemus
Copy link
Member

Closing in favor of #6681 (which contains more details).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: warnings related to the warnings builtin plugin plugin: xdist related to the xdist external plugin type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants