Skip to content

feat: fine-grained migration step control (closes #86)#92

Merged
croc100 merged 2 commits into
mainfrom
feat/step-control-86
Jun 15, 2026
Merged

feat: fine-grained migration step control (closes #86)#92
croc100 merged 2 commits into
mainfrom
feat/step-control-86

Conversation

@croc100

@croc100 croc100 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • upgrade_to(revision) — upgrade to a specific revision
  • upgrade_one() — upgrade exactly one step (+1)
  • downgrade_one() — downgrade exactly one step (-1)
  • downgrade_to(revision) — downgrade to a specific revision
  • current_revision() — return current Alembic revision (None if at base)

Closes #86. Achieves pytest-alembic parity for the data migration testing pattern:

def test_data_migration(mrt):
    mrt.upgrade_to("abc123")
    mrt.seed("users", [{"email": "legacy@example.com"}])
    mrt.upgrade_one()
    # assert transformed state

Test plan

  • test_upgrade_to — upgrades to specific revision, not beyond
  • test_upgrade_one — single-step advance from mid-chain
  • test_downgrade_one — single-step rollback
  • test_downgrade_to — rollback to specific revision
  • test_current_revision — tracks current revision through steps
  • test_step_control_data_migration_pattern — end-to-end: seed at mid-point, verify data survives further upgrade

…downgrade_one, downgrade_to, current_revision (#86)
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pytest_mrt/plugin.py 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@croc100 croc100 merged commit 41330d0 into main Jun 15, 2026
15 checks passed
@croc100 croc100 deleted the feat/step-control-86 branch June 15, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: fine-grained migration step control in mrt fixture (pytest-alembic parity)

2 participants