{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"A pytest plugin that runs built-in and custom tests against alembic database migrations to catch common issues like missing migrations, merge conflicts, and data-loss bugs.","skillfed_tags":["database-migrations","sqlalchemy","ci-testing"],"use_cases":["Catch forgotten migrations in CI before they reach production by asserting model definitions match the migration history.","Test complex data migrations with custom logic using the alembic_runner fixture to set up state and verify outcomes.","Detect diverged migration histories from merge conflicts automatically rather than discovering them during deployment.","Validate that all migrations can be reversed cleanly, ensuring your database can roll back if needed.","Ensure all SQLAlchemy models are properly imported and registered so autogenerate captures the full schema."],"what_it_does":"pytest-alembic is a pytest plugin that automates testing of alembic database migrations. It provides four built-in tests that catch common migration mistakes: ensuring a single head revision exists (no diverged history), verifying the full upgrade path works, confirming migrations match your SQLAlchemy model definitions, and validating that downgrades succeed. Beyond these defaults, it offers fixtures like `alembic_runner` to write custom tests for complex data migrations, letting you practice test-driven development on tricky migration logic before running against production.\n\nThe plugin sits between pytest and your alembic environment, running migrations in a test database and asserting their correctness. It solves real problems: catching forgotten migrations before merge, detecting migration failures with existing data, and preventing broken deployments from conflicting migrations merged in parallel. Most projects need minimal setup beyond what alembic itself requires.","worth_installing":"Yes. This package solves a real class of production bugs (broken migrations, merge conflicts, forgotten migrations) with low install friction and active maintenance. If you use alembic and SQLAlchemy, the built-in tests alone provide immediate value in CI. The custom test fixtures add flexibility for complex migrations. No known vulnerabilities, permissive license, and steady releases since 2020 make it a safe, practical choice."},"id":"pytest-alembic","links":{"html":"https://skillfed.io/packages/pytest-alembic","md":"https://skillfed.io/packages/pytest-alembic.md","pypi":"https://pypi.org/project/pytest-alembic/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-05-27","license_spdx":null,"license_treatment":"permissive","name":"pytest-alembic","python_support":"supports_current","summary":"A pytest plugin for verifying alembic migrations."},"popularity":{"monthly_downloads":1284731,"position":4111,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.12.1"}
