summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/requirements.py21
-rw-r--r--test/sql/test_compiler.py18
-rw-r--r--test/sql/test_selectable.py2
3 files changed, 20 insertions, 21 deletions
diff --git a/test/requirements.py b/test/requirements.py
index 355f8910e..4486973f6 100644
--- a/test/requirements.py
+++ b/test/requirements.py
@@ -1343,26 +1343,7 @@ class DefaultRequirements(SuiteRequirements):
@property
def percent_schema_names(self):
- return skip_if(
- [
- (
- "+psycopg2",
- None,
- None,
- "psycopg2 2.4 no longer accepts percent "
- "sign in bind placeholders",
- ),
- (
- "+psycopg2cffi",
- None,
- None,
- "psycopg2cffi does not accept percent signs in "
- "bind placeholders",
- ),
- ("mysql", None, None, "executemany() doesn't work here"),
- ("mariadb", None, None, "executemany() doesn't work here"),
- ]
- )
+ return exclusions.open()
@property
def order_by_label_with_expression(self):
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index ffabf9379..ef2f75b2d 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -941,6 +941,24 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
"AS z FROM keyed) AS anon_2) AS anon_1",
)
+ @testing.combinations("per cent", "per % cent", "%percent")
+ def test_percent_names_collide_with_anonymizing(self, name):
+ table1 = table("t1", column(name))
+
+ jj = select(table1.c[name]).subquery()
+ jjj = join(table1, jj, table1.c[name] == jj.c[name])
+
+ j2 = jjj.select().apply_labels().subquery("foo")
+
+ self.assert_compile(
+ j2.select(),
+ 'SELECT foo."t1_%(name)s", foo."anon_1_%(name)s" FROM '
+ '(SELECT t1."%(name)s" AS "t1_%(name)s", anon_1."%(name)s" '
+ 'AS "anon_1_%(name)s" FROM t1 JOIN (SELECT t1."%(name)s" AS '
+ '"%(name)s" FROM t1) AS anon_1 ON t1."%(name)s" = '
+ 'anon_1."%(name)s") AS foo' % {"name": name},
+ )
+
def test_exists(self):
s = select(table1.c.myid).where(table1.c.myid == 5)
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index b98fbd3d0..c75e8886d 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -740,7 +740,7 @@ class SelectableTest(
assert u2.corresponding_column(s1.selected_columns.col1) is u2.c.col1
assert u2.corresponding_column(s2.selected_columns.col1) is u2.c.col1
- def test_foo(self):
+ def test_union_alias_misc(self):
s1 = select(table1.c.col1, table1.c.col2)
s2 = select(table1.c.col2, table1.c.col1)