Skip to content

Commit e7c009e

Browse files
feat: pass --assume-in-transaction to squawk
Alembic migrations always run inside a transaction by default, so squawk should always be told to assume that context.
1 parent a2d5f85 commit e7c009e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

squawk_alembic/hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def main():
220220

221221
try:
222222
result = subprocess.run(
223-
["squawk", tmp_path],
223+
["squawk", "--assume-in-transaction", tmp_path],
224224
capture_output=True,
225225
text=True,
226226
)

tests/test_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def upgrade():
9999
assert "def456:abc123" in alembic_call
100100
squawk_call = mock_run.call_args_list[1][0][0]
101101
assert squawk_call[0] == "squawk"
102+
assert "--assume-in-transaction" in squawk_call
102103

103104

104105
def test_squawk_failure(repo, capsys):

0 commit comments

Comments
 (0)