Skip to content

Commit a65eaa0

Browse files
style: apply ruff formatting to test_main.py
1 parent 9c7507b commit a65eaa0

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

tests/test_main.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def upgrade():
8080

8181

8282
@patch("subprocess.run")
83-
def test_squawk_failure_replaces_tmp_path_in_output(mock_run, repo, capsys, monkeypatch):
83+
def test_squawk_failure_replaces_tmp_path_in_output(
84+
mock_run, repo, capsys, monkeypatch
85+
):
8486
"""Squawk output should show the original migration path, not the temp file path."""
8587
path = write_migration(
8688
repo,
@@ -304,7 +306,9 @@ def upgrade():
304306

305307

306308
@patch("subprocess.run")
307-
def test_multiple_files_first_fails_second_still_runs(mock_run, repo, capsys, monkeypatch):
309+
def test_multiple_files_first_fails_second_still_runs(
310+
mock_run, repo, capsys, monkeypatch
311+
):
308312
"""A failure in one file should not prevent linting of subsequent files."""
309313
path1 = write_migration(
310314
repo,
@@ -416,7 +420,9 @@ def upgrade():
416420
""",
417421
)
418422
mock_run.side_effect = fake_subprocess(git_branch_valid=False)
419-
monkeypatch.setattr(sys, "argv", ["squawk-alembic", "--diff-branch", "nonexistent", path])
423+
monkeypatch.setattr(
424+
sys, "argv", ["squawk-alembic", "--diff-branch", "nonexistent", path]
425+
)
420426
assert main() == 1
421427
# Only the git rev-parse validation call, then early exit
422428
assert mock_run.call_count == 1
@@ -439,7 +445,9 @@ def upgrade():
439445
op.execute("CREATE TABLE foo (id int)")
440446
""",
441447
)
442-
monkeypatch.setattr(sys, "argv", ["squawk-alembic", "--diff-branch", "refs/../main", path])
448+
monkeypatch.setattr(
449+
sys, "argv", ["squawk-alembic", "--diff-branch", "refs/../main", path]
450+
)
443451
assert main() == 1
444452
mock_run.assert_not_called()
445453
captured = capsys.readouterr()
@@ -511,7 +519,9 @@ def upgrade():
511519
git_fetch_succeeds=True,
512520
git_exists_on_branch=False,
513521
)
514-
monkeypatch.setattr(sys, "argv", ["squawk-alembic", "--diff-branch", "origin/main", path])
522+
monkeypatch.setattr(
523+
sys, "argv", ["squawk-alembic", "--diff-branch", "origin/main", path]
524+
)
515525
assert main() == 0
516526
# git rev-parse (fail) + git fetch + git cat-file + alembic + squawk = 5 calls
517527
assert mock_run.call_count == 5
@@ -540,7 +550,9 @@ def upgrade():
540550
git_branch_valid=False,
541551
git_fetch_succeeds=False,
542552
)
543-
monkeypatch.setattr(sys, "argv", ["squawk-alembic", "--diff-branch", "origin/main", path])
553+
monkeypatch.setattr(
554+
sys, "argv", ["squawk-alembic", "--diff-branch", "origin/main", path]
555+
)
544556
assert main() == 1
545557
# git rev-parse (fail) + git fetch (fail) = 2 calls
546558
assert mock_run.call_count == 2

0 commit comments

Comments
 (0)