From abef1d86797a1883761197deb96b50e18344684d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 29 Oct 2025 09:33:42 -0400 Subject: [PATCH] remove DB-based skips on non-backend tests for tests that are testing for SQL compilation only, there's no need to limit based on DB backend since we aren't using it. this avoids the awkward situation where tests like test_sqlite.py -> test_create_table_with_comment_ignored would be skipped when running the test suite against sqlite, but would run just fine when running against any other DB (because those DBs dont have a comment limitation and the test is just a compilation test). Change-Id: Iecd482e8c1034b28649ce5390dac0d0ddea83790 --- tests/test_mssql.py | 4 ---- tests/test_op.py | 3 --- tests/test_oracle.py | 5 ----- tests/test_postgresql.py | 6 ------ tests/test_sqlite.py | 2 -- 5 files changed, 20 deletions(-) diff --git a/tests/test_mssql.py b/tests/test_mssql.py index 2a78964f..70fe3653 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -23,7 +23,6 @@ from alembic import op from alembic import util from alembic.testing import assert_raises_message from alembic.testing import combinations -from alembic.testing import config from alembic.testing import eq_ from alembic.testing import expect_warnings from alembic.testing import fixture @@ -470,7 +469,6 @@ class OpTest(TestBase): lambda: Computed("foo * 5"), ), ) - @config.requirements.computed_columns def test_alter_column_computed_not_supported(self, sd, esd): op_fixture("mssql") assert_raises_message( @@ -485,7 +483,6 @@ class OpTest(TestBase): existing_server_default=esd(), ) - @config.requirements.identity_columns @combinations( ({},), (dict(always=True),), @@ -518,7 +515,6 @@ class OpTest(TestBase): lambda: Identity(), ), ) - @config.requirements.identity_columns def test_alter_column_identity_add_not_supported(self, sd, esd): op_fixture("mssql") assert_raises_message( diff --git a/tests/test_op.py b/tests/test_op.py index d85cd59d..473b586e 100644 --- a/tests/test_op.py +++ b/tests/test_op.py @@ -676,7 +676,6 @@ class OpTest(TestBase): "REFERENCES t2 (bat, hoho) INITIALLY deferred" ) - @config.requirements.foreign_key_match def test_add_foreign_key_match(self): context = op_fixture() op.create_foreign_key( @@ -1217,7 +1216,6 @@ class OpTest(TestBase): op.drop_index("ik_test", table_name="t1") context.assert_("DROP INDEX ik_test ON t1") - @config.requirements.comments def test_create_table_comment_op(self): context = op_fixture() @@ -1225,7 +1223,6 @@ class OpTest(TestBase): context.assert_("COMMENT ON TABLE some_table IS 'table comment'") - @config.requirements.comments def test_drop_table_comment_op(self): context = op_fixture() diff --git a/tests/test_oracle.py b/tests/test_oracle.py index 5763de01..2b5c4ba9 100644 --- a/tests/test_oracle.py +++ b/tests/test_oracle.py @@ -11,7 +11,6 @@ from alembic import command from alembic import op from alembic.testing import assert_raises_message from alembic.testing import combinations -from alembic.testing import config from alembic.testing import eq_ from alembic.testing import is_true from alembic.testing.env import _no_sql_testing_config @@ -68,7 +67,6 @@ class OpTest(TestBase): ) context.assert_("ALTER TABLE t1 ADD c1 INTEGER DEFAULT '12' NOT NULL") - @config.requirements.comments def test_add_column_with_comment(self): context = op_fixture("oracle") op.add_column( @@ -79,7 +77,6 @@ class OpTest(TestBase): "COMMENT ON COLUMN t1.c1 IS 'c1 comment'", ) - @config.requirements.computed_columns def test_add_column_computed(self): context = op_fixture("oracle") op.add_column( @@ -99,7 +96,6 @@ class OpTest(TestBase): lambda: Computed("foo * 5"), ), ) - @config.requirements.computed_columns def test_alter_column_computed_not_supported(self, sd, esd): op_fixture("oracle") assert_raises_message( @@ -242,7 +238,6 @@ class OpTest(TestBase): "ALTER TABLE t RENAME COLUMN c TO c2", ) - @config.requirements.comments def test_create_table_with_column_comments(self): context = op_fixture("oracle") op.create_table( diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py index c30e1773..0f43cf3b 100644 --- a/tests/test_postgresql.py +++ b/tests/test_postgresql.py @@ -347,7 +347,6 @@ class PostgresqlOpTest(TestBase): op.drop_table_comment("t2", existing_comment="t2 table", schema="foo") context.assert_("COMMENT ON TABLE foo.t2 IS NULL") - @config.requirements.computed_columns def test_add_column_computed(self): context = op_fixture("postgresql") op.add_column( @@ -369,7 +368,6 @@ class PostgresqlOpTest(TestBase): lambda: Computed("foo * 5"), ), ) - @config.requirements.computed_columns def test_alter_column_computed_not_supported(self, sd, esd): op_fixture("postgresql") assert_raises_message( @@ -384,7 +382,6 @@ class PostgresqlOpTest(TestBase): existing_server_default=esd(), ) - @config.requirements.identity_columns @combinations( ({}, None), (dict(always=True), None), @@ -406,7 +403,6 @@ class PostgresqlOpTest(TestBase): "INTEGER GENERATED %s AS IDENTITY%s" % (qualification, options) ) - @config.requirements.identity_columns @combinations( ({}, None), (dict(always=True), None), @@ -430,7 +426,6 @@ class PostgresqlOpTest(TestBase): "GENERATED %s AS IDENTITY%s" % (qualification, options) ) - @config.requirements.identity_columns def test_remove_identity_from_column(self): context = op_fixture("postgresql") op.alter_column( @@ -443,7 +438,6 @@ class PostgresqlOpTest(TestBase): "ALTER TABLE t1 ALTER COLUMN some_column DROP IDENTITY" ) - @config.requirements.identity_columns @combinations( ({}, dict(always=True), "SET GENERATED ALWAYS"), ( diff --git a/tests/test_sqlite.py b/tests/test_sqlite.py index 8a62f39b..e8ee21df 100644 --- a/tests/test_sqlite.py +++ b/tests/test_sqlite.py @@ -67,7 +67,6 @@ class SQLiteTest(TestBase): "sometable", ) - @config.requirements.comments def test_create_table_with_comment_ignored(self): context = op_fixture("sqlite") op.create_table( @@ -81,7 +80,6 @@ class SQLiteTest(TestBase): "c2 INTEGER, PRIMARY KEY (c1))" ) - @config.requirements.comments def test_add_column_with_comment_ignored(self): context = op_fixture("sqlite") op.add_column("t1", Column("c1", Integer, comment="c1 comment")) -- 2.47.3