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

Update FastAPI example test to use AnyIO #1147

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ljhenne
Copy link

@ljhenne ljhenne commented Jun 4, 2022

Description

  • Use client.portal.call rather than client.get_event_loop().run_until_complete to run async function get_user_by_db().
  • Replace event_loop fixture with portal fixture which just ensures that the portal has been instantiated within the client so that the Optional can be dropped from the type hint.

Motivation and Context

Fixes #1029. See comment #1029 (comment) for details.

How Has This Been Tested?

I ran make test and ensured all tests passed.

Checklist:

  • My code follows the code style of this project.

  • I have added the changelog accordingly.

  • I have read the CONTRIBUTING document.

  • All new and existing tests passed.
    - [ ] My change requires a change to the documentation.
    - [ ] I have updated the documentation accordingly.
    - [ ] I have added tests to cover my changes.

  • Did not add tests since this was to fix an existing test.

  • It looks like documentation should automatically pull the updated example code.

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.

Fastapi example test not working
1 participant