]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
remove DB-based skips on non-backend tests
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Oct 2025 13:33:42 +0000 (09:33 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Oct 2025 13:36:01 +0000 (09:36 -0400)
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
tests/test_op.py
tests/test_oracle.py
tests/test_postgresql.py
tests/test_sqlite.py

index 2a78964f7c59df15131e21334fc68f7e614d0fb7..70fe36536ad735cf5acc49a6c8104aec239d0a7b 100644 (file)
@@ -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(
index d85cd59dd3bafe4018e60d3bd44224f4dbf18dcf..473b586ef61fa7e9f2832888489214334722daa8 100644 (file)
@@ -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()
 
index 5763de0197a84d600b5e54c72b7e6fe33744e8d5..2b5c4ba95e6be4ffeaddac92212378f520b54a4d 100644 (file)
@@ -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(
index c30e177305ec341b4a1114f658a7b0cf3b760fb8..0f43cf3b0d6cba3ab1a4c0d04840002dfef2c8a2 100644 (file)
@@ -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"),
         (
index 8a62f39bd44f6b97cae387c04f6cfca63088821c..e8ee21df0ac3b5ee05a390c389fe988827535c1f 100644 (file)
@@ -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"))