summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-01-23 14:29:25 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-01-23 14:35:49 -0500
commit110f02e17612bcd98d6a2cb09cc6dbc02b6b26fc (patch)
treebafb9dc3278ce240f0ee7f79a56298471db78875
parentdc4eb7904e228d2de2f7b1cfabf752203858f11b (diff)
downloadsqlalchemy-110f02e17612bcd98d6a2cb09cc6dbc02b6b26fc.tar.gz
- move out match compiler test to test_compiler
- test_query isn't assertscompiledsql (cherry picked from commit 269313218ddd06a21387085295c553becbd00e46) (cherry picked from commit cd3ea1d56bdec8b5b00cd10c5ecc6017bb99bcdd)
-rw-r--r--test/dialect/mysql/test_compiler.py6
-rw-r--r--test/dialect/mysql/test_query.py23
2 files changed, 8 insertions, 21 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py
index a115ed043..a7315de35 100644
--- a/test/dialect/mysql/test_compiler.py
+++ b/test/dialect/mysql/test_compiler.py
@@ -184,6 +184,12 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
schema.CreateTable(t2).compile, dialect=mysql.dialect()
)
+ def test_match(self):
+ matchtable = table('matchtable', column('title', String))
+ self.assert_compile(
+ matchtable.c.title.match('somstr'),
+ "MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE)")
+
def test_for_update(self):
table1 = table('mytable',
column('myid'), column('name'), column('description'))
diff --git a/test/dialect/mysql/test_query.py b/test/dialect/mysql/test_query.py
index 040004808..bdf2d303a 100644
--- a/test/dialect/mysql/test_query.py
+++ b/test/dialect/mysql/test_query.py
@@ -2,11 +2,11 @@
from sqlalchemy.testing import eq_
from sqlalchemy import *
-from sqlalchemy.testing import fixtures, AssertsCompiledSQL
+from sqlalchemy.testing import fixtures
from sqlalchemy import testing
-class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
+class MatchTest(fixtures.TestBase):
__only_on__ = 'mysql'
@classmethod
@@ -53,25 +53,6 @@ class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
def teardown_class(cls):
metadata.drop_all()
- @testing.fails_on('mysql+mysqlconnector', 'uses pyformat')
- def test_expression(self):
- format = testing.db.dialect.paramstyle == 'format' and '%s' or '?'
- self.assert_compile(
- matchtable.c.title.match('somstr'),
- "MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE)" % format)
-
- @testing.fails_on('mysql+mysqldb', 'uses format')
- @testing.fails_on('mysql+pymysql', 'uses format')
- @testing.fails_on('mysql+cymysql', 'uses format')
- @testing.fails_on('mysql+oursql', 'uses format')
- @testing.fails_on('mysql+pyodbc', 'uses format')
- @testing.fails_on('mysql+zxjdbc', 'uses format')
- def test_expression(self):
- format = '%(title_1)s'
- self.assert_compile(
- matchtable.c.title.match('somstr'),
- "MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE)" % format)
-
def test_simple_match(self):
results = (matchtable.select().
where(matchtable.c.title.match('python')).