Kludex / starlette-testclient

A backport of Starlette's TestClient using requests! ⏪️
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

AttributeError: module 'anyio' has no attribute 'start_blocking_portal' #5

Closed grigi closed 4 months ago

grigi commented 8 months ago

Using anyio>=4.0.0 breaks:

  File "/home/grigi/work/magneto/.pyenv/lib64/python3.11/site-packages/starlette_testclient/_testclient.py", line 450, in _portal_factory
    with anyio.start_blocking_portal(**self.async_backend) as portal:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'anyio' has no attribute 'start_blocking_portal'

Downgrading to anyio<4 resolves the issue.

chbndrhnns commented 6 months ago

@Kludex I am facing this issue while using schemathesis. Could you maybe either drop anyio 3 or support both versions?