Skip to content

Commit

Permalink
fix(httpx): remove deprecated HttpConfig options
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Nov 30, 2024
1 parent 15a13dd commit 0e492be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/prisma/_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any, Type, Tuple, Mapping, TypeVar, Callable, Coroutine
from typing import Any, Type, Tuple, TypeVar, Callable, Coroutine
from typing_extensions import (
Literal as Literal,
NewType,
Expand Down Expand Up @@ -60,7 +60,6 @@ class _GenericAlias(Protocol):
# NOTE: we don't support some options as their type hints are not publicly exposed
# https://github.com/encode/httpx/discussions/1977
class HttpConfig(TypedDict, total=False):
app: Callable[[Mapping[str, Any], Any], Any]
http1: bool
http2: bool
limits: httpx.Limits
Expand Down
9 changes: 1 addition & 8 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warnings
from typing import TYPE_CHECKING, Any, Mapping
from typing import TYPE_CHECKING, Any
from pathlib import Path
from datetime import timedelta

Expand Down Expand Up @@ -127,8 +126,6 @@ def mock___init__(real__init__: Any, *args: Any, **kwargs: Any) -> None:

getter = patch_method(monkeypatch, httpx.AsyncClient, '__init__', mock___init__)

def mock_app(args: Mapping[str, object], data: object) -> object: ...

async def _test(config: HttpConfig) -> None:
client = Prisma(
http=config,
Expand Down Expand Up @@ -157,10 +154,6 @@ async def _test(config: HttpConfig) -> None:
},
)

with warnings.catch_warnings():
warnings.simplefilter('ignore')
await _test({'app': mock_app})


def test_old_client_alias() -> None:
"""Ensure that Prisma can be imported from the root package under the Client alias"""
Expand Down

0 comments on commit 0e492be

Please sign in to comment.