You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 5, 2024. It is now read-only.
If an open file is provided by a fixture, the plugin reports an open file error regardless of the fact that the fixture properly closes the file.
Example code that is run by pytest --open-files test.py, where test.py is as follows. The expectation is that this should pass without error.
import pytest
@pytest.fixture
def provide_fh(tmp_path):
"""Provide a file handle"""
# Create a file just to have one.
path = tmp_path / 'junk.txt'
fd = open(path, 'w')
fd.write('There is junk in them hills\n')
fd.close()
with open(path) as read_fd:
yield read_fd
def test_teardown(provide_fh):
assert True