Skip to content

Commit 0ff3f0f

Browse files
author
stoa-automerge
committed
style: format + autofix drift; re-apply test_w805 orphaned-return fix (lost to add-glob)
1 parent 10630b7 commit 0ff3f0f

11 files changed

Lines changed: 27 additions & 34 deletions

tests/test_cmd_stats.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ def test_count_git_commits_missing_timestamp_returns_zero() -> None:
1919
conn = sqlite3.connect(":memory:")
2020
conn.execute("CREATE TABLE git_commits (id INTEGER PRIMARY KEY)")
2121

22-
assert _count_git_commits(
23-
conn,
24-
"SELECT COUNT(*) FROM git_commits WHERE timestamp >= ?",
25-
(0,),
26-
) == 0
22+
assert (
23+
_count_git_commits(
24+
conn,
25+
"SELECT COUNT(*) FROM git_commits WHERE timestamp >= ?",
26+
(0,),
27+
)
28+
== 0
29+
)
2730

2831

2932
def test_count_git_commits_unexpected_operational_error_raises() -> None:

tests/test_cmd_understand_tour_graph_errors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def boom(_conn):
1717
monkeypatch.setattr(builder, "build_symbol_graph", boom)
1818
monkeypatch.setattr(cmd_tour, "_entry_points", lambda _conn: entry_points)
1919
monkeypatch.setattr(cmd_tour, "_reading_order", lambda _conn, _graph: pytest.fail("graph fallback not used"))
20-
monkeypatch.setattr(cmd_tour, "_top_symbols", lambda _conn, _graph, limit=10: pytest.fail("graph fallback not used"))
20+
monkeypatch.setattr(
21+
cmd_tour, "_top_symbols", lambda _conn, _graph, limit=10: pytest.fail("graph fallback not used")
22+
)
2123

2224
assert cmd_understand._gather_tour_data(object(), None) == {
2325
"reading_order": [],

tests/test_cmd_why_fail_exception_scope.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import ast
44
from pathlib import Path
55

6-
76
_MODULE = Path("src/roam/commands/cmd_why_fail.py")
87

98

@@ -23,12 +22,7 @@ def test_why_fail_bfs_catches_only_missing_networkx_nodes() -> None:
2322
for node in ast.walk(tree):
2423
if not isinstance(node, ast.Try):
2524
continue
26-
call_names = [
27-
_name(call.func)
28-
for stmt in node.body
29-
for call in ast.walk(stmt)
30-
if isinstance(call, ast.Call)
31-
]
25+
call_names = [_name(call.func) for stmt in node.body for call in ast.walk(stmt) if isinstance(call, ast.Call)]
3226
if "nx.single_source_shortest_path_length" in call_names:
3327
bfs_handlers.extend(node.handlers)
3428

tests/test_constitution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232
from roam.constitution.loader import ( # noqa: E402
3333
Constitution,
34+
_deprecated_commands,
35+
_known_commands,
3436
_project_name,
3537
apply_constitution,
3638
check_constitution,
3739
constitution_path,
3840
init_constitution,
3941
load_constitution,
40-
_deprecated_commands,
41-
_known_commands,
4242
)
4343

4444
# ---------------------------------------------------------------------------

tests/test_flag_dead.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ def test_index_read_database_error_falls_back_to_filesystem(self, tmp_path, monk
9090
project = tmp_path / "project"
9191
project.mkdir()
9292
(project / "app.py").write_text(
93-
"def enabled(client):\n"
94-
" return client.variation('stale-flag', False)\n",
93+
"def enabled(client):\n return client.variation('stale-flag', False)\n",
9594
encoding="utf-8",
9695
)
9796

tests/test_guard_pr_and_github_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import pytest
1515
from click.testing import CliRunner
1616

17-
from roam.commands import cmd_guard_pr
1817
from roam.cli import cli
18+
from roam.commands import cmd_guard_pr
1919
from roam.github_check import (
2020
SUMMARY_BYTE_CAP,
2121
VERDICT_TO_CONCLUSION,

tests/test_health_baseline.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,12 @@ def test_health_baseline_last_resolves_most_recent(cli_runner, indexed_project,
266266

267267
def test_health_baseline_auto_filesystem_root_error_falls_back(monkeypatch):
268268
"""--baseline auto falls back to cwd only for filesystem root failures."""
269-
from roam.commands import cmd_health
270269
import roam.db.connection as db_connection
270+
from roam.commands import cmd_health
271271

272272
conn = sqlite3.connect(":memory:")
273273
conn.row_factory = sqlite3.Row
274-
conn.execute(
275-
"CREATE TABLE snapshots (timestamp INTEGER, git_branch TEXT, git_commit TEXT, health_score INTEGER)"
276-
)
274+
conn.execute("CREATE TABLE snapshots (timestamp INTEGER, git_branch TEXT, git_commit TEXT, health_score INTEGER)")
277275
conn.execute(
278276
"INSERT INTO snapshots (timestamp, git_branch, git_commit, health_score) VALUES (?, ?, ?, ?)",
279277
(123, "main", "abc1234", 90),
@@ -293,14 +291,12 @@ def _raise_oserror():
293291

294292
def test_health_baseline_auto_project_root_programmer_error_propagates(monkeypatch):
295293
"""--baseline auto must not swallow bug-class project-root failures."""
296-
from roam.commands import cmd_health
297294
import roam.db.connection as db_connection
295+
from roam.commands import cmd_health
298296

299297
conn = sqlite3.connect(":memory:")
300298
conn.row_factory = sqlite3.Row
301-
conn.execute(
302-
"CREATE TABLE snapshots (timestamp INTEGER, git_branch TEXT, git_commit TEXT, health_score INTEGER)"
303-
)
299+
conn.execute("CREATE TABLE snapshots (timestamp INTEGER, git_branch TEXT, git_commit TEXT, health_score INTEGER)")
304300

305301
def _raise_typeerror():
306302
raise TypeError("bad find_project_root refactor")

tests/test_runtime.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,7 @@ def test_cli_ingest_trace_callback_name_is_distinct_from_mcp_wrapper(self):
416416
from roam.cli import _COMMANDS
417417
from roam.commands.cmd_ingest_trace import ingest_trace_cmd
418418

419-
mcp_function_names = {
420-
name for name, obj in inspect.getmembers(mcp_server, inspect.isfunction)
421-
}
419+
mcp_function_names = {name for name, obj in inspect.getmembers(mcp_server, inspect.isfunction)}
422420
assert _COMMANDS["ingest-trace"] == ("roam.commands.cmd_ingest_trace", "ingest_trace_cmd")
423421
assert ingest_trace_cmd.callback.__name__ == "ingest_trace_cmd"
424422
assert ingest_trace_cmd.callback.__name__ not in mcp_function_names

tests/test_stale_refs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,9 @@ def _raise_type_error(*_args, **_kwargs):
24882488

24892489
monkeypatch.setattr(stale_refs, "_check_one_external_url", _raise_type_error)
24902490
with pytest.raises(TypeError, match="bad worker"):
2491-
stale_refs._check_external_urls_parallel([("https://example.com", "README.md", 1)], timeout=0.5, concurrency=1)
2491+
stale_refs._check_external_urls_parallel(
2492+
[("https://example.com", "README.md", 1)], timeout=0.5, concurrency=1
2493+
)
24922494

24932495

24942496
class TestStaleRefsWatchHelpersComposition:

tests/test_w607_e_cmd_search_warnings_out_envelope.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,7 @@ def test_caller_unmodified():
644644
(
645645
n
646646
for n in tree.body
647-
if isinstance(n, ast.Assign)
648-
and any(isinstance(t, ast.Name) and t.id == "search" for t in n.targets)
647+
if isinstance(n, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "search" for t in n.targets)
649648
),
650649
None,
651650
)

0 commit comments

Comments
 (0)