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

Py310 loop fixup #2294

Merged
merged 4 commits into from Oct 28, 2021
Merged

Py310 loop fixup #2294

merged 4 commits into from Oct 28, 2021

Conversation

sjsadowski
Copy link
Contributor

Will handle errors thrown in asgi MockProtocol class for py310

@sjsadowski
Copy link
Contributor Author

I am not sure how I'd write a test for this change. I'm open to suggestions.

@sjsadowski sjsadowski marked this pull request as ready for review October 28, 2021 21:28
@sjsadowski sjsadowski requested a review from a team as a code owner October 28, 2021 21:28
@sjsadowski
Copy link
Contributor Author

Resolves #2293

ahopkins
ahopkins previously approved these changes Oct 28, 2021
@ahopkins
Copy link
Member

I am not sure how I'd write a test for this change. I'm open to suggestions.

I think you would monkeypatch asyncio.Event with a mock. Then in the test check the python version and either assert that it was or was not called with the loop.

It is probably not a critical test though.

sanic/models/asgi.py Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Oct 28, 2021

Code Climate has analyzed commit 36e88cd and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 66.6% (86% is the threshold).

This pull request will bring the total coverage in the repository to 86.7% (0.0% change).

View more on Code Climate.

@sjsadowski sjsadowski merged commit a361b34 into main Oct 28, 2021
@sjsadowski sjsadowski deleted the py310-loop-fixup branch October 28, 2021 22:16
ChihweiLHBird pushed a commit to ChihweiLHBird/sanic that referenced this pull request Jun 1, 2022
* Fixup for 3.8+; Sanic still supports 3.7 where loop is required

* Added branching statement to hanle asyncio.Event() loop parameter removal in 3.10, and optional supply in 3.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants