Skip to content

Commit 9de186a

Browse files
committed
style: Reformat long lines and conditions for improved readability.
1 parent 4aba6d7 commit 9de186a

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

src/apcore/registry/registry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,11 @@ def _handle_file_change(self, path: str) -> None:
924924
self._lowercase_map[new_id.lower()] = new_id
925925
self._trigger_event("register", new_id, instance)
926926
# Resume: restore suspended state into new instance
927-
if suspended_state is not None and hasattr(instance, "on_resume") and callable(instance.on_resume):
927+
if (
928+
suspended_state is not None
929+
and hasattr(instance, "on_resume")
930+
and callable(instance.on_resume)
931+
):
928932
try:
929933
instance.on_resume(suspended_state)
930934
except Exception as e:

tests/schema/test_annotations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def test_new_annotation_fields_defaults(self) -> None:
6666
assert result.pagination_style == "cursor"
6767

6868
def test_new_annotation_fields_from_code(self) -> None:
69-
code = ModuleAnnotations(cacheable=True, cache_ttl=300, cache_key_fields=["id"], paginated=True, pagination_style="offset")
69+
code = ModuleAnnotations(
70+
cacheable=True, cache_ttl=300, cache_key_fields=["id"], paginated=True, pagination_style="offset"
71+
)
7072
result = merge_annotations(None, code)
7173
assert result.cacheable is True
7274
assert result.cache_ttl == 300

tests/schema/test_exporter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ def test_meta_defaults(self) -> None:
135135
def test_meta_with_annotations(self) -> None:
136136
sd = _make_schema_def()
137137
ann = _make_annotations(
138-
cacheable=True, cache_ttl=600, cache_key_fields=["id", "name"],
139-
paginated=True, pagination_style="offset",
138+
cacheable=True,
139+
cache_ttl=600,
140+
cache_key_fields=["id", "name"],
141+
paginated=True,
142+
pagination_style="offset",
140143
)
141144
exporter = SchemaExporter()
142145
result = exporter.export_mcp(sd, annotations=ann)

tests/test_suspend_resume.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ def test_suspend_error_logged_reload_succeeds(self, caplog: pytest.LogCaptureFix
243243
reload_mod = _make_reload(registry)
244244
new_mod = _PlainModuleV2()
245245

246-
with caplog.at_level(logging.ERROR), patch.object(
247-
reload_mod, "_rediscover_module", return_value=new_mod
248-
):
246+
with caplog.at_level(logging.ERROR), patch.object(reload_mod, "_rediscover_module", return_value=new_mod):
249247
result = reload_mod.execute(
250248
{"module_id": "broken.suspend", "reason": "test"},
251249
context=None,
@@ -266,9 +264,7 @@ def test_resume_error_logged_reload_succeeds(self, caplog: pytest.LogCaptureFixt
266264
# New module also has broken on_resume
267265
new_mod = _BrokenResumeModule()
268266

269-
with caplog.at_level(logging.ERROR), patch.object(
270-
reload_mod, "_rediscover_module", return_value=new_mod
271-
):
267+
with caplog.at_level(logging.ERROR), patch.object(reload_mod, "_rediscover_module", return_value=new_mod):
272268
result = reload_mod.execute(
273269
{"module_id": "broken.resume", "reason": "test"},
274270
context=None,

0 commit comments

Comments
 (0)