From eff6c5eb909a589c008950553b4a2b296ce9fe8a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 5 May 2012 12:47:38 -0400 Subject: [PATCH] - some mysql test tweaks ported from 0.7 --- CHANGES | 12 ++++++------ lib/sqlalchemy/test/requires.py | 14 ++++++++++++++ test/engine/test_transaction.py | 5 +++++ test/orm/test_naturalpks.py | 3 +++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 2a41fac507..b0f810c3b6 100644 --- a/CHANGES +++ b/CHANGES @@ -20,9 +20,9 @@ CHANGES if against a column expression that combined multiple entities together. [ticket:2197] - - [bug] fixed inappropriate evaluation of user-mapped - object in a boolean context within query.get() - [ticket:2310]. + - [bug] fixed inappropriate evaluation of user-mapped + object in a boolean context within query.get() + [ticket:2310]. - Fixed bug apparent only in Python 3 whereby sorting of persistent + pending objects during @@ -68,9 +68,9 @@ CHANGES - Cls.column.collate("some collation") now works. [ticket:1776] - - [bug] Fixed the error formatting raised when - a tuple is inadvertently passed to session.query() - [ticket:2297]. + - [bug] Fixed the error formatting raised when + a tuple is inadvertently passed to session.query() + [ticket:2297]. - engine - Backported the fix for [ticket:2317] introduced diff --git a/lib/sqlalchemy/test/requires.py b/lib/sqlalchemy/test/requires.py index 92dc6186dc..f922dd5d9d 100644 --- a/lib/sqlalchemy/test/requires.py +++ b/lib/sqlalchemy/test/requires.py @@ -325,12 +325,26 @@ def _has_sqlite(): except ImportError: return False +def _has_mysql_on_windows(): + return testing.against('mysql') and \ + testing.db.dialect._server_casing == 1 + def sqlite(fn): return _chain_decorators_on( fn, skip_if(lambda: not _has_sqlite()) ) +def skip_mysql_on_windows(fn): + """Catchall for a large variety of MySQL on Windows failures""" + + return _chain_decorators_on( + fn, + skip_if(_has_mysql_on_windows, + "Not supported on MySQL + Windows" + ) + ) + def english_locale_on_postgresql(fn): return _chain_decorators_on( fn, diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py index 05ab42f710..91e9a32a33 100644 --- a/test/engine/test_transaction.py +++ b/test/engine/test_transaction.py @@ -270,6 +270,11 @@ class TransactionTest(TestBase): [(1, ), (2, )]) connection.close() + # PG emergency shutdown: + # select * from pg_prepared_xacts + # ROLLBACK PREPARED '' + @testing.crashes('mysql', 'Crashing on 5.5, not worth it') + @testing.requires.skip_mysql_on_windows @testing.requires.two_phase_transactions @testing.requires.savepoints def test_mixed_two_phase_transaction(self): diff --git a/test/orm/test_naturalpks.py b/test/orm/test_naturalpks.py index 4a55afb939..d131cf92eb 100644 --- a/test/orm/test_naturalpks.py +++ b/test/orm/test_naturalpks.py @@ -14,6 +14,9 @@ from sqlalchemy.test.testing import eq_ from test.orm import _base, _fixtures class NaturalPKTest(_base.MappedTest): + # MySQL 5.5 on Windows crashes (the entire server, not the client) + # if you screw around with ON UPDATE CASCADE type of stuff. + __requires__ = 'skip_mysql_on_windows', @classmethod def define_tables(cls, metadata): -- 2.47.3