Skip to content

ResourceWarning in xprocess.ensure #119

@davidism

Description

@davidism

Just upgraded to 0.21 from 0.20 for Werkzeug, and am now getting resource warnings from within pytest-xprocess.

pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]> Traceback (most recent call last): File "/home/david/.local/share/virtualenvs/werkzeug/lib/python3.10/site-packages/xprocess/xprocess.py", line 274, in ensure lines = info.logpath.open().readlines() ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/david/Projects/pallets/werkzeug/.pytest_cache/d/.xprocess/dev_server-test_streaming_chunked_response/xprocess.log' mode='r' encoding='UTF-8'> 

The line it's pointing to is this, where a file is opened but not closed.

# skip previous process logs
lines = info.logpath.open().readlines()

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions