Skip to content
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

Emit ResourceWarning on unclosed memory object streams #715

Merged
merged 7 commits into from
Apr 13, 2024

Conversation

agronholm
Copy link
Owner

This resurrects #663, but in a simpler format.

@@ -1922,6 +1920,8 @@ async def _call_in_runner_task(
self._run_tests_and_fixtures(receive_stream)
)

self._runner_task.add_done_callback(lambda _: self._send_stream.close())
Copy link
Collaborator

@graingert graingert Apr 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be nicer to do:

async def coro():
    try:
        self._run_tests_and_fixtures(receive_stream)
    finally:
        self._send_stream.close()

self._runner_task = self.get_loop().create_task(coro())

?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about now?

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.

3 participants