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

allow passing anyio backend options via TestClient constructor #1209

Closed
2 tasks done
graingert opened this issue Jun 23, 2021 · 1 comment
Closed
2 tasks done

allow passing anyio backend options via TestClient constructor #1209

graingert opened this issue Jun 23, 2021 · 1 comment

Comments

@graingert
Copy link
Member

graingert commented Jun 23, 2021

Checklist

  • There are no similar issues or pull requests for this yet.
  • I discussed this idea on the community chat and feedback is positive.

Is your feature related to a problem? Please describe.

I want to be able to:

def test_foo(anyio_backend_name, anyio_backend_options):
    with starlette.testing.TestClient(
        create_app(),
        backend=anyio_backend_name,
        backend_options=anyio_backend_options,
    ) as client:
        ...

Describe the solution you would like.

allow passing anyio backend options via TestClient constructor

Describe alternatives you considered

None

Additional context

this is needed so I can easily run the fastapi test suite on both trio and asyncio

@graingert
Copy link
Member Author

fixed in #1211

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 a pull request may close this issue.

1 participant