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:29:25 -0500
commit269313218ddd06a21387085295c553becbd00e46 (patch)
tree88d9ad2d3ec29fe09feb1d5ec27e69c78bb93397
parent24bad4bf1af8c794948270c0e043adf2ecf8b7e2 (diff)
downloadsqlalchemy-269313218ddd06a21387085295c553becbd00e46.tar.gz
- move out match compiler test to test_compiler
- test_query isn't assertscompiledsql
-rw-r--r--test/dialect/mysql/test_compiler.py6
-rw-r--r--test/dialect/mysql/test_query.py28
2 files changed, 11 insertions, 23 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py
index 60af82bab..0571ce526 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 85513167c..c6b7a1036 100644
--- a/test/dialect/mysql/test_query.py
+++ b/test/dialect/mysql/test_query.py
@@ -2,10 +2,11 @@
from sqlalchemy.testing import eq_, is_
from sqlalchemy import *
-from sqlalchemy.testing import fixtures, AssertsCompiledSQL
+from sqlalchemy.testing import fixtures
from sqlalchemy import testing
-class IdiosyncrasyTest(fixtures.TestBase, AssertsCompiledSQL):
+
+class IdiosyncrasyTest(fixtures.TestBase):
__only_on__ = 'mysql'
__backend__ = True
@@ -27,7 +28,7 @@ class IdiosyncrasyTest(fixtures.TestBase, AssertsCompiledSQL):
)
-class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
+class MatchTest(fixtures.TestBase):
__only_on__ = 'mysql'
__backend__ = True
@@ -75,25 +76,6 @@ class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
def teardown_class(cls):
metadata.drop_all()
- @testing.fails_on('mysql+mysqlconnector', 'uses pyformat')
- def test_expression_format(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_pyformat(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')).
@@ -176,7 +158,7 @@ class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
eq_([1, 3, 5], [r.id for r in results])
-class AnyAllTest(fixtures.TablesTest, AssertsCompiledSQL):
+class AnyAllTest(fixtures.TablesTest):
__only_on__ = 'mysql'
__backend__ = True