pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Reducing user confusion from `pytest.warns(None)`

Open Zac-HD opened this issue 5 years ago • 2 comments

with pytest.warns(None): has the same effect as with pytest.warns(Warning):, but is often confused with the meaning "does not emit any warning". I think we should therefore:

  • change the docs to show with pytest.warns() (no arguments) as the catch-anything default
  • change the default argument from None to Warning
  • emit a deprecation warning if passed None, and treat it as Warning (for now)

I'm saving this one for the Mentored Sprints - experienced contributors please wait a week or so :smiley:

Zac-HD avatar May 08 '21 04:05 Zac-HD

I would like to work on this :)

olgarithms avatar May 15 '21 10:05 olgarithms

Closed by #8677 🎉

Zac-HD avatar May 19 '21 08:05 Zac-HD