Skip to content

Commit 175d55e

Browse files
author
Tom Softreck
committed
update
1 parent 7db45ed commit 175d55e

File tree

2 files changed

+86
-23
lines changed

2 files changed

+86
-23
lines changed

setup.cfg

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,87 @@
11
[metadata]
22
description-file = README.md
33

4-
[tool:isort]
4+
[isort]
55
profile = black
66
line_length = 88
77
multi_line_output = 3
88
include_trailing_comma = true
99
force_grid_wrap = 0
1010
use_parentheses = true
1111
ensure_newline_before_comments = true
12+
known_first_party = dialogchain
13+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
1214

1315
[flake8]
1416
max-line-length = 88
15-
extend-ignore = E203
16-
max-complexity = 18
17-
select = B,C,E,F,W,T4,B9
17+
extend-ignore = E203, W503
18+
extend-select = ANN, B, C, E, F, I, N, S, W, TCH, TID, UP, YTT
19+
max-complexity = 15
20+
per-file-ignores =
21+
# Allow star imports in __init__.py
22+
__init__.py: F403,F401
23+
# Allow re-exports
24+
**/__init__.py: F401
25+
# Allow type comments
26+
**/*.py: TCH001,TCH002,TCH003
1827

1928
[mypy]
2029
python_version = 3.8
21-
warn_return_any = True
22-
warn_unused_configs = True
23-
disallow_untyped_defs = True
24-
check_untyped_defs = True
25-
no_implicit_optional = True
26-
warn_redundant_casts = True
27-
warn_unused_ignores = True
28-
warn_no_return = True
29-
warn_unreachable = True
30-
show_error_codes = True
30+
warn_return_any = true
31+
warn_unused_configs = true
32+
disallow_untyped_defs = true
33+
check_untyped_defs = true
34+
no_implicit_optional = true
35+
warn_redundant_casts = true
36+
warn_unused_ignores = true
37+
warn_no_return = true
38+
warn_unreachable = true
39+
show_error_codes = true
40+
disallow_any_generics = true
41+
disallow_subclassing_any = true
42+
disallow_untyped_calls = true
43+
disallow_untyped_decorators = true
44+
no_implicit_reexport = true
45+
strict_equality = true
46+
warn_unused_configs = true
47+
warn_unused_ignores = true
48+
49+
[coverage:run]
50+
source = dialogchain
51+
branch = true
52+
omit =
53+
**/tests/*
54+
**/__init__.py
55+
**/version.py
56+
57+
[coverage:report]
58+
exclude_lines =
59+
pragma: no cover
60+
def __repr__
61+
if self.debug:
62+
raise NotImplementedError
63+
if 0:
64+
if __name__ == .__main__.:
65+
raise ImportError
66+
except ImportError
67+
68+
[bandit]
69+
exclude_dirs = .git,.tox,__pycache__,venv,build,dist
70+
skips = B101,B104,B110,B311,B405,B410,B603,B607
71+
72+
[pycodestyle]
73+
max-line-length = 88
74+
exclude = .git,__pycache__,build,dist
75+
76+
[pydocstyle]
77+
add-ignore = D100,D104,D105,D107,D200,D203,D212,D400,D401,D415
78+
match = (?!test_).*\.py
79+
80+
[pyright]
81+
pythonVersion = "3.8"
82+
pythonPlatform = "Linux"
83+
typeCheckingMode = "strict"
84+
useLibraryCodeForTypes = true
85+
disableTypeCommentChecks = true
86+
reportMissingTypeStubs = false
87+
reportOptionalMemberAccess = true

tests/integration/test_http_connector.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,31 @@
1010

1111

1212
class TestHTTPConnectorIntegration:
13-
"""Integration tests for HTTP connector with mock endpoints"""
13+
"""Integration tests for HTTP connector with mock endpoints."""
1414

1515
@pytest.fixture
16-
def mock_http_server(self, unused_tcp_port):
17-
"""Fixture to create a mock HTTP server"""
18-
from aiohttp import web
19-
20-
async def handle_echo(request):
16+
def mock_http_server(self, unused_tcp_port: int) -> tuple[web.AppRunner, str]:
17+
"""Create a mock HTTP server for testing.
18+
19+
Args:
20+
unused_tcp_port: A free port number provided by pytest.
21+
22+
Returns:
23+
A tuple containing the web server runner and its URL.
24+
"""
25+
async def handle_echo(request: web.Request) -> web.Response:
26+
"""Handle echo requests by returning the received JSON data."""
2127
data = await request.json()
2228
return web.json_response({"echo": data})
23-
29+
2430
app = web.Application()
2531
app.router.add_post("/echo", handle_echo)
26-
32+
2733
runner = web.AppRunner(app)
2834
return runner, f"http://localhost:{unused_tcp_port}"
2935

3036
@pytest.mark.asyncio
31-
async def test_http_connector_with_mock_server(self, mock_http_server):
37+
async def test_http_connector_with_mock_server(self, mock_http_server: tuple[web.AppRunner, str]) -> None:
3238
"""Test HTTP connector with a mock HTTP server"""
3339
runner, server_url = mock_http_server
3440

0 commit comments

Comments
 (0)