Skip to content

Commit

Permalink
Merge pull request #26 from nlocascio/nl/fix_assignment_exception
Browse files Browse the repository at this point in the history
Fix assignment exception
  • Loading branch information
DanCardin committed Aug 4, 2021
2 parents 2314837 + 5bd94c2 commit 1b9bbae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pytest-alembic"
version = "0.3.1"
version = "0.3.2"
description = "A pytest plugin for verifying alembic migrations."
authors = [
"Dan Cardin <ddcardin@gmail.com>",
Expand Down
30 changes: 15 additions & 15 deletions src/pytest_alembic/tests.py
Expand Up @@ -91,20 +91,20 @@ def test_up_down_consistency(alembic_runner):
Individually upgrade to ensure that it's clear which revision caused the failure.
"""
try:
for revision in alembic_runner.history.revisions:
for revision in alembic_runner.history.revisions:
try:
alembic_runner.migrate_up_to(revision)
except RuntimeError as e:
raise AlembicTestFailure(
"Failed to upgrade through each revision individually.",
context=[("Failing Revision", revision), ("Alembic Error", str(e))],
)

try:
for revision in reversed(alembic_runner.history.revisions):
except RuntimeError as e:
raise AlembicTestFailure(
"Failed to upgrade through each revision individually.",
context=[("Failing Revision", revision), ("Alembic Error", str(e))],
)

for revision in reversed(alembic_runner.history.revisions):
try:
alembic_runner.migrate_down_to(revision)
except RuntimeError as e:
raise AlembicTestFailure(
"Failed to downgrade through each revision individually.",
context=[("Failing Revision", revision), ("Alembic Error", str(e))],
)
except RuntimeError as e:
raise AlembicTestFailure(
"Failed to downgrade through each revision individually.",
context=[("Failing Revision", revision), ("Alembic Error", str(e))],
)

0 comments on commit 1b9bbae

Please sign in to comment.