Skip to content
Closed
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
13 changes: 13 additions & 0 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,19 @@ def __init__(
cookies=cookies,
)

@property
def auth(self) -> httpx.Auth | None:
"""
Authentication class used when none is passed at the request-level.

See also [HTTPX Authentication](https://www.python-httpx.org/quickstart/#authentication).
"""
return self._auth

@auth.setter
def auth(self, auth: httpx._types.AuthTypes) -> None:
self._auth = self._build_auth(auth)

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