Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
stacklevel=2,
)

_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.from_thread.BlockingPortal]]

ASGIInstance = Callable[[Receive, Send], Awaitable[None]]
ASGI2App = Callable[[Scope], ASGIInstance]
Expand Down Expand Up @@ -371,7 +371,7 @@ async def send(message: Message) -> None:
class TestClient(httpx.Client):
__test__ = False
task: Future[None]
portal: anyio.abc.BlockingPortal | None = None
portal: anyio.from_thread.BlockingPortal | None = None

def __init__(
self,
Expand Down Expand Up @@ -414,7 +414,7 @@ def __init__(
)

@contextlib.contextmanager
def _portal_factory(self) -> Generator[anyio.abc.BlockingPortal, None, None]:
def _portal_factory(self) -> Generator[anyio.from_thread.BlockingPortal, None, None]:
if self.portal is not None:
yield self.portal
else:
Expand Down