Skip to content

Can't filter rewrite warnings #4439

@shaicantor

Description

@shaicantor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: warningsrelated to the warnings builtin pluginplugin: xdistrelated to the xdist external plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions