Add more examples in the `warnings` docs
This is a follow-up of GH-86438 and GH-23172. The warnings docs should include more examples to show how to match different types of warnings using both the provided functions and -W/PYTHONWARNINGS, especially since they behave differently.
At the bottom of https://github.com/pytest-dev/pytest/discussions/8759#discussioncomment-2818984 there are already some examples to illustrate some of the differences, even though some are specific to pytest.
Linked PRs
- gh-106618
Hi there, first time contributor here. I'd be happy to attempt this if that would be OK?
@Jamesgo1 Hi, that would be great, thanks!
See https://devguide.python.org for info about building docs and contributing PRs, and also feel free to ask here too.
Hello, my name is Liam, and I’m part of a student software engineer group of 4 at Carnegie Mellon. We’ve been tasked with contributing to an open source project, and this issue seems like a great first start. Would you mind assigning this to me (my group)? Also, you might see the same comment on 1-2 other issues, since we’ll likely be working on more than just one for our assignment.
Hi Liam and your group! Sounds great!
We don't usually assign issues, because sometimes people don't get around to making PRs for a wide variety of reasons, and we don't want others to think they've been pre-booked.
Instead, please go ahead with it, and don't hesitate to ask questions :)
Hi @ezio-melotti ! I've made a PR with some new examples inspired from your link, can you take a look?
@daniel-shimon is this issue still open to work on or you have created a PR so it's closed now? @hugovk
Hello! EuroPython 2024 - Sprints attendee here :) If this is still open, can I take it?
@mirelagrigoras Hello! This issue already has a PR, although it's been open for a year. I'll give a ping on the PR, although I doubt we'll get an answer during today's sprint, so I suggest finding another issue. Thanks!
Hi! I'd like to work on this. I see #106618 is linked—is that PR still active, or can I take a fresh approach?
If available, my plan is to:
Add 4–5 runnable code examples showing different warning filter patterns (using functions and -W/PYTHONWARNINGS)
Reference the pytest examples mentioned and adapt them for general use
Update Doc/library/warnings.rst with clear, tested examples
ETA: 2–3 days if this is still open. Thanks!
is that PR still active, or can I take a fresh approach
I don't think there is any new approach to take as the author addressed comments and we still need to review them. Also it was still active some months ago which is fine for a PR here IMO.