Skip to content

Aligning with asyncio recommendations in test #86

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

allrob23
Copy link

Hello, Im doing research on asyncio best practices, I noticed that the test test_eventworker directly instantiates a StreamWriter, while the official documentation suggests:

It is not recommended to instantiate StreamReader objects directly; use open_connection() and start_server() instead.

I understand that for testing purposes this approach works well and does not cause any real issues. However, I'd like to suggest a small refactoring using mocks with the appropriate specs and the open_connection() function, which maintains the same test coverage while aligning with recommended practices.

What do you think of this approach? It's a minor change that could serve as an example of best practices for future contributors, but I'm open to feedback.

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.

1 participant