Skip to content

Commit 2f2a872

Browse files
sandhoseclaude
andcommitted
Clean up stale config, fix DummyResponse headers, and harden shutdown
- Remove mypy.ini sections referencing deleted files (proxyagent_twisted, twisted_test_helpers, asyncio_test_helpers, test_httpproxy_*) - Use CIMultiDict for DummyResponse.headers so .getall() works if tests ever exercise the retry/5xx code path - Wrap individual pushkin.close() calls in try/except during shutdown so one failure doesn't prevent cleanup of remaining pushkins Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a51da54 commit 2f2a872

3 files changed

Lines changed: 7 additions & 18 deletions

File tree

mypy.ini

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,5 @@ disallow_untyped_defs = False
2323
[mypy-sygnal.sygnal]
2424
disallow_untyped_defs = False
2525

26-
[mypy-tests.asyncio_test_helpers]
27-
disallow_untyped_defs = False
28-
29-
[mypy-tests.test_httpproxy_asyncio]
30-
disallow_untyped_defs = False
31-
32-
[mypy-tests.test_httpproxy_twisted]
33-
disallow_untyped_defs = False
34-
3526
[mypy-tests.testutils]
3627
disallow_untyped_defs = False
37-
38-
[mypy-tests.twisted_test_helpers]
39-
disallow_untyped_defs = False
40-
41-
[mypy-sygnal.helper.proxy.proxyagent_twisted]
42-
ignore_errors = True

sygnal/sygnal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,11 @@ async def _start(self) -> None:
194194
try:
195195
await asyncio.Event().wait()
196196
finally:
197-
for pushkin in self.pushkins.values():
198-
await pushkin.close()
197+
for name, pushkin in self.pushkins.items():
198+
try:
199+
await pushkin.close()
200+
except Exception:
201+
logger.exception("Error closing pushkin %s", name)
199202
await runner.cleanup()
200203

201204
def run(self) -> None:

tests/testutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import Any, Dict, List, Union
1212

1313
import pytest_asyncio
14+
from multidict import CIMultiDict
1415

1516
from sygnal.http import create_app
1617
from sygnal.sygnal import CONFIG_DEFAULTS, Sygnal, merge_left_with_defaults
@@ -265,7 +266,7 @@ async def _multi_requests(
265266
class DummyResponse:
266267
def __init__(self, code):
267268
self.status = code
268-
self.headers: Dict[str, str] = {}
269+
self.headers: CIMultiDict[str] = CIMultiDict()
269270

270271

271272
def make_async_magic_mock(ret_val):

0 commit comments

Comments
 (0)