From: Mike Bayer Date: Sat, 23 Jan 2016 19:29:25 +0000 (-0500) Subject: - move out match compiler test to test_compiler X-Git-Tag: rel_1_1_0b1~84^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269313218ddd06a21387085295c553becbd00e46;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - move out match compiler test to test_compiler - test_query isn't assertscompiledsql --- diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index 60af82bab7..0571ce5260 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 85513167c6..c6b7a1036b 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