summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorKai Mueller <15907922+kasium@users.noreply.github.com>2021-06-24 11:57:20 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-06-28 10:26:01 -0400
commit7e5e40ff849c92e4c062bad28848b5bdbb8bdd80 (patch)
treec9f4908f14aff9ba8874f043743190452393ee73 /test/sql
parent2f909a6b127e3ff8f8d411db28094804c8b9a2df (diff)
downloadsqlalchemy-7e5e40ff849c92e4c062bad28848b5bdbb8bdd80.tar.gz
Fix missing None handling of Table.prefixes
Fixed issue where passing ``None`` for the value of :paramref:`_schema.Table.prefixes` would not store an empty list, but rather the constant ``None``, which may be unexpected by third party dialects. The issue is revealed by a usage in recent versions of Alembic that are passing ``None`` for this value. Pull request courtesy Kai Mueller. Fixes: #6685 Closes: #6672 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6672 Pull-request-sha: b79aca0ee4011b244978b35fed4c687ffbe56dc9 Change-Id: I758641c6fbde6f2607d074fecea7efa6728aeea0
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_metadata.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py
index 9e0253052..08502b8bb 100644
--- a/test/sql/test_metadata.py
+++ b/test/sql/test_metadata.py
@@ -1622,6 +1622,12 @@ class TableTest(fixtures.TestBase, AssertsCompiledSQL):
"CREATE VIRTUAL TABLE temporary_table_2 (col1 INTEGER)",
)
+ @testing.combinations((None, []), ((), []), ([], []), (["foo"], ["foo"]))
+ def test_prefixes_parameter_parsing(self, arg, expected):
+ """test #6685"""
+ table = Table("foo", MetaData(), Column("bar", Integer), prefixes=arg)
+ eq_(table._prefixes, expected)
+
def test_table_info(self):
metadata = MetaData()
t1 = Table("foo", metadata, info={"x": "y"})