Skip to content

Fix ResourceWarning from forked output streams - #108

Open
janmrow wants to merge 1 commit into
pytest-dev:masterfrom
janmrow:fix-unclosed-output-streams
Open

janmrow wants to merge 1 commit into
pytest-dev:masterfrom
janmrow:fix-unclosed-output-streams

Conversation

@janmrow

@janmrow janmrow commented Sep 16, 2026

Copy link
Copy Markdown

Fixes the ResourceWarning / PytestUnraisableExceptionWarning reported in #106 for tests executed with @pytest.mark.forked.

The output streams created for the forked worker were not fully cleaned up, which could leave the temporary stdout/stderr files unclosed.

This PR ensures those resources are cleaned up while preserving the existing forked test behavior and output handling.

A regression test was added. The regression test fails on current master and passes with this change.

Closes #106.

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.

ResourceWarning/PytestUnraisableExceptionWarning with version 1.7.5

1 participant