Remove --model

This commit is contained in:
Patrick Arminio
2025-10-16 21:21:48 +01:00
parent 8f72e4e0a5
commit 7c98f59a23
3 changed files with 62 additions and 22 deletions

View File

@@ -44,6 +44,13 @@ def migration_env(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> MigrationT
shutil.copy(model_source, models_file)
# Create pyproject.toml with [tool.sqlmodel] configuration
pyproject_content = """\
[tool.sqlmodel]
models = "test_models.models"
"""
(tmp_path / "pyproject.toml").write_text(pyproject_content)
monkeypatch.setenv("DATABASE_URL", db_url)
monkeypatch.chdir(tmp_path)
@@ -67,8 +74,6 @@ def test_create_first_migration(migration_env: MigrationTestEnv):
"create",
"-m",
"Initial migration",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],
@@ -105,8 +110,6 @@ def test_running_migration_twice_only_generates_migration_once(
"create",
"-m",
"Initial migration",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],
@@ -121,8 +124,6 @@ def test_running_migration_twice_only_generates_migration_once(
[
"migrations",
"migrate",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],
@@ -138,8 +139,6 @@ def test_running_migration_twice_only_generates_migration_once(
"create",
"-m",
"Initial migration",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],
@@ -169,8 +168,6 @@ def test_cannot_create_migration_with_pending_migrations(
"create",
"-m",
"Initial migration",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],
@@ -187,8 +184,6 @@ def test_cannot_create_migration_with_pending_migrations(
"create",
"-m",
"Second migration",
"--models",
"test_models.models",
"--path",
str(migration_env.migrations_dir),
],