Skip to content

Commit 85c484a

Browse files
committed
Add missing type annotations.
1 parent 3e428b5 commit 85c484a

File tree

18 files changed

+54
-54
lines changed

18 files changed

+54
-54
lines changed

tests/client_generators/dependencies/test_async_base_client.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@pytest.mark.asyncio
22-
async def test_execute_sends_post_to_correct_url_with_correct_payload(httpx_mock):
22+
async def test_execute_sends_post_to_correct_url_with_correct_payload(httpx_mock) -> None:
2323
httpx_mock.add_response()
2424

2525
client = AsyncBaseClient(url="http://base_url/endpoint")
@@ -44,7 +44,7 @@ async def test_execute_sends_post_to_correct_url_with_correct_payload(httpx_mock
4444

4545

4646
@pytest.mark.asyncio
47-
async def test_execute_parses_pydantic_variables_before_sending(httpx_mock):
47+
async def test_execute_parses_pydantic_variables_before_sending(httpx_mock) -> None:
4848
class TestModel1(BaseModel):
4949
a: int
5050

@@ -110,7 +110,7 @@ class TestModel1(BaseModel):
110110

111111

112112
@pytest.mark.asyncio
113-
async def test_execute_sends_payload_without_unset_arguments(httpx_mock):
113+
async def test_execute_sends_payload_without_unset_arguments(httpx_mock) -> None:
114114
httpx_mock.add_response()
115115
client = AsyncBaseClient(url="http://base_url")
116116
query_str = """
@@ -185,7 +185,7 @@ class TestInputA(BaseModel):
185185
@pytest.mark.asyncio
186186
async def test_execute_sends_payload_with_serialized_datetime_without_exception(
187187
httpx_mock,
188-
):
188+
) -> None:
189189
httpx_mock.add_response()
190190
client = AsyncBaseClient(url="http://base_url")
191191
query_str = "query Abc($arg: DATETIME) { abc }"
@@ -212,7 +212,7 @@ async def test_execute_sends_request_with_correct_content_type(httpx_mock):
212212
@pytest.mark.asyncio
213213
async def test_execute_sends_request_with_extra_headers_and_correct_content_type(
214214
httpx_mock,
215-
):
215+
) -> None:
216216
httpx_mock.add_response()
217217
client = AsyncBaseClient(url="http://base_url", headers={"h_key": "h_value"})
218218

@@ -224,7 +224,7 @@ async def test_execute_sends_request_with_extra_headers_and_correct_content_type
224224

225225

226226
@pytest.mark.asyncio
227-
async def test_execute_passes_kwargs_to_json_post(mocker):
227+
async def test_execute_passes_kwargs_to_json_post(mocker) -> None:
228228
http_client = mocker.AsyncMock()
229229

230230
await AsyncBaseClient(url="http://base_url", http_client=http_client).execute(
@@ -236,7 +236,7 @@ async def test_execute_passes_kwargs_to_json_post(mocker):
236236

237237

238238
@pytest.mark.asyncio
239-
async def test_execute_sends_json_request_with_headers_from_passed_kwargs(httpx_mock):
239+
async def test_execute_sends_json_request_with_headers_from_passed_kwargs(httpx_mock) -> None:
240240
httpx_mock.add_response()
241241
client = AsyncBaseClient(
242242
url="http://base_url",
@@ -263,7 +263,7 @@ async def test_execute_sends_json_request_with_headers_from_passed_kwargs(httpx_
263263
@pytest.mark.asyncio
264264
async def test_execute_sends_file_with_multipart_form_data_content_type(
265265
httpx_mock, txt_file
266-
):
266+
) -> None:
267267
httpx_mock.add_response()
268268

269269
client = AsyncBaseClient(url="http://base_url")
@@ -276,7 +276,7 @@ async def test_execute_sends_file_with_multipart_form_data_content_type(
276276

277277

278278
@pytest.mark.asyncio
279-
async def test_execute_sends_file_as_multipart_request(httpx_mock, txt_file):
279+
async def test_execute_sends_file_as_multipart_request(httpx_mock, txt_file) -> None:
280280
httpx_mock.add_response()
281281
query_str = "query Abc($file: Upload!) { abc(file: $file) }"
282282

@@ -307,7 +307,7 @@ async def test_execute_sends_file_as_multipart_request(httpx_mock, txt_file):
307307

308308

309309
@pytest.mark.asyncio
310-
async def test_execute_sends_file_from_memory(httpx_mock, in_memory_txt_file):
310+
async def test_execute_sends_file_from_memory(httpx_mock, in_memory_txt_file) -> None:
311311
httpx_mock.add_response()
312312
query_str = "query Abc($file: Upload!) { abc(file: $file) }"
313313

@@ -338,7 +338,7 @@ async def test_execute_sends_file_from_memory(httpx_mock, in_memory_txt_file):
338338

339339

340340
@pytest.mark.asyncio
341-
async def test_execute_sends_multiple_files(httpx_mock, txt_file, png_file):
341+
async def test_execute_sends_multiple_files(httpx_mock, txt_file, png_file) -> None:
342342
httpx_mock.add_response()
343343
query_str = "query Abc($files: [Upload!]!) { abc(files: $files) }"
344344

@@ -374,7 +374,7 @@ async def test_execute_sends_multiple_files(httpx_mock, txt_file, png_file):
374374

375375

376376
@pytest.mark.asyncio
377-
async def test_execute_sends_nested_file(httpx_mock, txt_file):
377+
async def test_execute_sends_nested_file(httpx_mock, txt_file) -> None:
378378
class InputType(BaseModel):
379379
file_: Any
380380

@@ -408,7 +408,7 @@ class InputType(BaseModel):
408408

409409

410410
@pytest.mark.asyncio
411-
async def test_execute_sends_each_file_only_once(httpx_mock, txt_file):
411+
async def test_execute_sends_each_file_only_once(httpx_mock, txt_file) -> None:
412412
httpx_mock.add_response()
413413
query_str = "query Abc($files: [Upload!]!) { abc(files: $files) }"
414414

@@ -439,7 +439,7 @@ async def test_execute_sends_each_file_only_once(httpx_mock, txt_file):
439439

440440

441441
@pytest.mark.asyncio
442-
async def test_execute_passes_kwargs_to_multipart_post(mocker, txt_file):
442+
async def test_execute_passes_kwargs_to_multipart_post(mocker, txt_file) -> None:
443443
http_client = mocker.AsyncMock()
444444

445445
await AsyncBaseClient(url="http://base_url", http_client=http_client).execute(
@@ -457,7 +457,7 @@ async def test_execute_passes_kwargs_to_multipart_post(mocker, txt_file):
457457
@pytest.mark.asyncio
458458
async def test_execute_sends_multipart_request_with_headers_from_passed_kwargs(
459459
httpx_mock, txt_file
460-
):
460+
) -> None:
461461
httpx_mock.add_response()
462462
client = AsyncBaseClient(
463463
url="http://base_url",
@@ -494,7 +494,7 @@ async def test_execute_sends_multipart_request_with_headers_from_passed_kwargs(
494494
)
495495
def test_get_data_raises_graphql_client_http_error(
496496
mocker, status_code, response_content
497-
):
497+
) -> None:
498498
client = AsyncBaseClient(url="base_url", http_client=mocker.MagicMock())
499499
response = httpx.Response(
500500
status_code=status_code, content=json.dumps(response_content)
@@ -509,7 +509,7 @@ def test_get_data_raises_graphql_client_http_error(
509509
@pytest.mark.parametrize("response_content", ["invalid_json", {"not_data": ""}, ""])
510510
def test_get_data_raises_graphql_client_invalid_response_error(
511511
mocker, response_content
512-
):
512+
) -> None:
513513
client = AsyncBaseClient(url="base_url", http_client=mocker.MagicMock())
514514
response = httpx.Response(status_code=200, content=json.dumps(response_content))
515515

@@ -553,7 +553,7 @@ def test_get_data_raises_graphql_client_invalid_response_error(
553553
},
554554
],
555555
)
556-
def test_get_data_raises_graphql_client_graphql_multi_error(mocker, response_content):
556+
def test_get_data_raises_graphql_client_graphql_multi_error(mocker, response_content) -> None:
557557
client = AsyncBaseClient(url="base_url", http_client=mocker.MagicMock())
558558

559559
with pytest.raises(GraphQLClientGraphQLMultiError):
@@ -566,7 +566,7 @@ def test_get_data_raises_graphql_client_graphql_multi_error(mocker, response_con
566566
"response_content",
567567
[{"errors": [], "data": {}}, {"errors": None, "data": {}}, {"data": {}}],
568568
)
569-
def test_get_data_doesnt_raise_exception(mocker, response_content):
569+
def test_get_data_doesnt_raise_exception(mocker, response_content) -> None:
570570
client = AsyncBaseClient(url="base_url", http_client=mocker.MagicMock())
571571

572572
data = client.get_data(
@@ -577,7 +577,7 @@ def test_get_data_doesnt_raise_exception(mocker, response_content):
577577

578578

579579
@pytest.mark.asyncio
580-
async def test_base_client_used_as_context_manager_closes_http_client(mocker):
580+
async def test_base_client_used_as_context_manager_closes_http_client(mocker) -> None:
581581
fake_client = mocker.AsyncMock()
582582
async with AsyncBaseClient(url="base_url", http_client=fake_client) as base_client:
583583
await base_client.execute("")

tests/client_generators/dependencies/test_exceptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
)
55

66

7-
def test_from_dict_returns_graphql_error_with_parsed_data():
7+
def test_from_dict_returns_graphql_error_with_parsed_data() -> None:
88
error_dict = {
99
"message": "Error message",
1010
"locations": [{"line": 6, "column": 7}],
@@ -25,7 +25,7 @@ def test_from_dict_returns_graphql_error_with_parsed_data():
2525
assert result.original == error_dict
2626

2727

28-
def test_from_errors_dicts_returns_graphql_multi_error_with_parsed_data():
28+
def test_from_errors_dicts_returns_graphql_multi_error_with_parsed_data() -> None:
2929
errors_dicts = [
3030
{
3131
"message": "Error message",

tests/main/clients/client_forward_refs/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/client_forward_refs_shorter_results/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/custom_config_file/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/custom_files_names/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/custom_query_builder/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/custom_scalars/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/example/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/extended_models/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/fragments_on_abstract_types/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/inline_fragments/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/interface_as_fragment/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/multiple_fragments/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/only_used_inputs_and_enums/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/operations/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/remote_schema/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

tests/main/clients/shorter_results/expected_client/async_base_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
except ImportError:
2929
from contextlib import asynccontextmanager
3030

31-
@asynccontextmanager # type: ignore
32-
async def ws_connect(*args, **kwargs): # pylint: disable=unused-argument
31+
@asynccontextmanager
32+
async def ws_connect(*args: Any, **kwargs: Any) -> AsyncIterator[None]: # pylint: disable=unused-argument
3333
raise NotImplementedError("Subscriptions require 'websockets' package.")
3434
yield # pylint: disable=unreachable
3535

0 commit comments

Comments
 (0)