From 110f02e17612bcd98d6a2cb09cc6dbc02b6b26fc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 23 Jan 2016 14:29:25 -0500 Subject: [PATCH] - move out match compiler test to test_compiler - test_query isn't assertscompiledsql (cherry picked from commit 269313218ddd06a21387085295c553becbd00e46) (cherry picked from commit cd3ea1d56bdec8b5b00cd10c5ecc6017bb99bcdd) --- test/dialect/mysql/test_compiler.py | 6 ++++++ test/dialect/mysql/test_query.py | 23 ++--------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index a115ed0439..a7315de35d 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 0400048086..bdf2d303a6 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')). -- 2.47.3