Skip to content

doc: add ResourceWarning section explaining GC-delayed behavior#14644

Open
tanishmisra9 wants to merge 1 commit into
pytest-dev:mainfrom
tanishmisra9:fix-9825-resourcewarning-docs
Open

doc: add ResourceWarning section explaining GC-delayed behavior#14644
tanishmisra9 wants to merge 1 commit into
pytest-dev:mainfrom
tanishmisra9:fix-9825-resourcewarning-docs

Conversation

@tanishmisra9

Copy link
Copy Markdown

Closes #9825

Adds a ResourceWarning section to the warnings how-to, immediately below the DeprecationWarning and PendingDeprecationWarning section.

Explains that ResourceWarning is emitted by the garbage collector at finalization time rather than at the leak site, which is why filterwarnings / @pytest.mark.filterwarnings / -W error::ResourceWarning often miss it. Documents error::pytest.PytestUnraisableExceptionWarning as the reliable workaround.

Includes a seealso cross-link to the existing tracemalloc Resource Warnings section.
tox -e docs passes with no new warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs on warnings filters should note that ResourceWarning is often delayed

1 participant