Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
nrbnlulu committed Sep 17, 2024
1 parent a66dbf7 commit d27075f
Show file tree
Hide file tree
Showing 13 changed files with 732 additions and 604 deletions.
2 changes: 1 addition & 1 deletion benchmark/benches/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def fastapi_bench(

durations = []
async with httpx.AsyncClient(
transport=ASGITransport(app), # type: ignore[arg-type]
transport=ASGITransport(app),
base_url="http://test",
) as client:
for _ in range(iterations):
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benches/strawberry.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def bench_strawberry(
"""

async with httpx.AsyncClient(
transport=ASGITransport(app), # type: ignore[arg-type]
transport=ASGITransport(app),
base_url="http://test",
) as client:
for resolver_name in resolver_names:
Expand Down
1,301 changes: 716 additions & 585 deletions pdm.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ dev = [
"trio>=0.25.0",
"uvicorn>=0.29.0",
"aiogram>=3.5.0",
"strawberry-graphql @ git+https://github.com/nrbnlulu/strawberry.git@support_extensions_on_subscriptions",
]
docs = [
"mkdocs>=1.6.0",
Expand Down
1 change: 0 additions & 1 deletion tests/container/test_future_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_provider_fn_with_deffered_dep() -> None:


def test_provider_fn_deffered_dep_missuse() -> None:

with pytest.raises(ValueError) as exc_info: # noqa: PT011
from tests.container.mod_tests import (
provider_fn_deffered_dep_missuse, # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion tests/context/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self) -> None:

def __await__(self) -> Generator[Any, None, None]:
self.awaited = True
return anyio.sleep(0).__await__()
return anyio.sleep(0).__await__() # noqa: ASYNC115


async def _async_awaitable() -> _AwaitableCls:
Expand Down
2 changes: 1 addition & 1 deletion tests/ext/fastapi/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def route_with_depends(
@pytest.fixture
async def http_client(app: FastAPI) -> AsyncIterator[httpx.AsyncClient]:
async with httpx.AsyncClient(
transport=ASGITransport(app), # type: ignore[arg-type]
transport=ASGITransport(app),
base_url="http://test",
) as client:
yield client
1 change: 0 additions & 1 deletion tests/ext/strawberry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def baz(self, scoped_node: Annotated[ScopedNode, Inject]) -> str:

@strawberry.type
class _Subscription:

@strawberry.subscription
@inject
async def live_bars(
Expand Down
2 changes: 1 addition & 1 deletion tests/ext/strawberry/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def http_client(
app: GraphQL[Any, Any],
) -> AsyncIterator[httpx.AsyncClient]:
async with httpx.AsyncClient(
transport=ASGITransport(app), # type: ignore[arg-type]
transport=ASGITransport(app),
base_url="http://test",
) as client:
yield client
4 changes: 2 additions & 2 deletions tests/providers/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def __init__(
pass

def test(
a: Annotated[int, Inject], # noqa: ARG001
b: Annotated[Test, Inject], # noqa: ARG001
a: Annotated[int, Inject],
b: Annotated[Test, Inject],
) -> None:
pass

Expand Down
10 changes: 5 additions & 5 deletions tests/providers/test_scoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def factory() -> int:


def test_type_hints_on_function() -> None:
def factory(a: int, b: str) -> None: # noqa: ARG001
def factory(a: int, b: str) -> None:
pass

provider = providers.Scoped(factory)
Expand All @@ -77,7 +77,7 @@ def __init__(self, a: int, b: str) -> None:

def test_annotated_type_hint() -> None:
def factory(
a: Annotated[int, Inject()], # noqa: ARG001
a: Annotated[int, Inject()],
) -> None:
pass

Expand Down Expand Up @@ -113,12 +113,12 @@ def factory() -> None:

def test_dependencies() -> None:
def factory(
a: int, # noqa: ARG001
service: Annotated[ # noqa: ARG001
a: int,
service: Annotated[
dict[str, int],
Inject(),
],
string: Annotated[str, Inject()], # noqa: ARG001
string: Annotated[str, Inject()],
) -> None:
pass

Expand Down
6 changes: 3 additions & 3 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

def test_inject_annotations_returns_all_inject_markers() -> None:
def func(
a: int, # noqa: ARG001
b: Annotated[int, Inject], # noqa: ARG001
c: Annotated[int, Inject()], # noqa: ARG001
a: int,
b: Annotated[int, Inject],
c: Annotated[int, Inject()],
) -> None:
pass

Expand Down
2 changes: 1 addition & 1 deletion tests/validation/test_dependency_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ def test_err() -> None:
assert len(exc_info.value.errors) == 1
err = exc_info.value.errors[0]
assert isinstance(err, DependencyNotFoundError)
assert err.dependency == int
assert err.dependency is int

0 comments on commit d27075f

Please sign in to comment.