Skip to content

Serve test server in thread#292

Merged
florimondmanca merged 1 commit into
masterfrom
refactor/test-server
Aug 29, 2019
Merged

Serve test server in thread#292
florimondmanca merged 1 commit into
masterfrom
refactor/test-server

Conversation

@florimondmanca

Copy link
Copy Markdown
Contributor

@florimondmanca florimondmanca changed the title Put test server in thread Serve test server in thread Aug 29, 2019

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me :)

@florimondmanca

Copy link
Copy Markdown
Contributor Author

Thanks @sethmlarson, I'll merge once the build passes. :-)

Comment thread tests/test_concurrency.py
assert (await stream.read(8192, timeout)).startswith(b"HTTP/1.1 200 OK\r\n")

finally:
await stream.close()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the record, I had to add this .close() call otherwise uvicorn would wait for the connection to terminate indefinitely and not shut down. In general I think it's best to make sure we do use the async with or .close() API on the objects manipulated in tests when possible, as we do in the core package.

@florimondmanca florimondmanca merged commit 994403b into master Aug 29, 2019
@florimondmanca florimondmanca deleted the refactor/test-server branch August 29, 2019 21:17
florimondmanca added a commit that referenced this pull request Aug 29, 2019
Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
Bumps [trustme](https://github.com/python-trio/trustme) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/python-trio/trustme/releases)
- [Commits](python-trio/trustme@v0.6.0...v0.7.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
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.

2 participants