Testing toolkit for Alembic migrations — run your migrations through the gauntlet
Project description
alembic-gauntlet
Testing toolkit for Alembic migrations — run your migrations through the gauntlet
Installation
pip install alembic-gauntlet
Requirements: Python 3.11+
Quick start
import pytest
from alembic_gauntlet import MigrationTestBase
from sqlalchemy import MetaData
from myapp.db import Base
@pytest.mark.integration
class TestMyMigrations(MigrationTestBase):
"""All five tests inherited automatically."""
@pytest.fixture
def orm_metadata(self) -> MetaData:
return Base.metadata
@pytest.fixture(scope="session")
def migration_db_url(self) -> str:
return "postgresql+asyncpg://user:pass@localhost/testdb"
That's it! You now have:
test_stairway_upgrade_downgrade— each migration forward and backtest_migrations_up_to_date— schema matches ORM modelstest_single_head_revision— no unmerged branchestest_downgrade_all_the_way— full downgrade to basetest_naming_conventions— indexes and FKs follow conventions
Documentation
Full documentation at bedrock-python.github.io/alembic-gauntlet.
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alembic_gauntlet-0.1.0.tar.gz.
File metadata
- Download URL: alembic_gauntlet-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6f04cdc076d348a9caf688792a8d7b0625b2a9c292e7f91aa219d72aee6a92d
|
|
| MD5 |
6f69bf888fe5b6d537534ea8b034f535
|
|
| BLAKE2b-256 |
d860df25789812d977a46db779a13dadc03f06181731004fb8cc6e6b99d6e244
|
File details
Details for the file alembic_gauntlet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: alembic_gauntlet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c750773015c2a4af95fb049b8edff89d765a9b37a826a35924c0520b0613757
|
|
| MD5 |
b59ec9bb1e35b9da13d7203e9886df93
|
|
| BLAKE2b-256 |
ab45dd21f3a98bcea37355b0d0aa36c3558f5e3b6a554f2cc302024181df8444
|