ResourceWarning: unclosed file favicon.ico
Categories
(Socorro :: Backend, defect, P3)
Tracking
(Not tracked)
People
(Reporter: relud, Unassigned)
References
Details
when cleaning up suppressed pytest warnings after removing boto in bug 1908543, I found out that a couple tests in webapp/crashstats/crashstats/tests/test_views.py were failing on:
ResourceWarning: unclosed file <_io.FileIO name='/app/webapp/crashstats/crashstats/static/img/favicon.ico' mode='rb' closefd=True>
I adjusted the warning suppression to be more specific, but we should fix the tests.
Comment 1•1 year ago
|
||
I don't think we can/should fix the test. This is coming from whatever is serving static files.
We could add a decorator to the test function to ignore this warning rather than ignore it in the filterwarnings:
https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings
Then the ignoring is closer to the thing that needs ignoring.
Comment 2•10 months ago
|
||
In talking with Sven, this warning is related to how GC works based on the Python implementation. Since we're using CPython, which uses reference counting for GC, this warning isn't a problem for us. Also this is test code. Marking this as WONTFIX.
Description
•