-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Add helper to check that no ResourceWarning is emitted #70513
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
Comments
Victor proposed in bpo-25994 to use special context manager to check that no ResourceWarning is emitted. I think that this helper can be useful in other tests. It saves 3 lines for every use. Proposed patch adds it in test.support. |
Oh, I didn't expect that so many existing test already use the same pattern to check for ResourceWarning. Nice patch! I added a comment: we must be careful in the documentation of the helper. |
I was about to suggest adding this to test.support as well. Patch looks good to me. |
Addressed Victor's comments. This pattern is not widely used. Usually only raising ResourceWarning is tested, but not non-raising. |
test_support_check_no_resource_warning_2.patch LGTM, thanks. |
New changeset e9a4b30e3e43 by Serhiy Storchaka in branch '3.5': New changeset faf676d8c054 by Serhiy Storchaka in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: