From e41c0f4107a132b2feac83ba07a25a336e7eae0b Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Fri, 9 May 2008 20:26:09 +0000 Subject: Test suite modernization in progress. Big changes: - @unsupported now only accepts a single target and demands a reason for not running the test. - @exclude also demands an exclusion reason - Greatly expanded @testing.requires., eliminating many decorators in the suite and signficantly easing integration of multi-driver support. - New ORM test base class, and a featureful base for mapped tests - Usage of 'global' for shared setup going away, * imports as well --- test/dialect/mysql.py | 10 +++++----- test/dialect/postgres.py | 4 ++-- test/dialect/sqlite.py | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'test/dialect') diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py index 6a261ddcd..bdcdf1800 100644 --- a/test/dialect/mysql.py +++ b/test/dialect/mysql.py @@ -177,7 +177,7 @@ class TypesTest(TestBase, AssertsExecutionResults): raise numeric_table.drop() - @testing.exclude('mysql', '<', (4, 1, 1)) + @testing.exclude('mysql', '<', (4, 1, 1), 'no charset support') def test_charset(self): """Exercise CHARACTER SET and COLLATE-ish options on string types.""" @@ -261,7 +261,7 @@ class TypesTest(TestBase, AssertsExecutionResults): raise charset_table.drop() - @testing.exclude('mysql', '<', (5, 0, 5)) + @testing.exclude('mysql', '<', (5, 0, 5), 'a 5.0+ feature') def test_bit_50(self): """Exercise BIT types on 5.0+ (not valid for all engine types)""" @@ -381,7 +381,7 @@ class TypesTest(TestBase, AssertsExecutionResults): finally: meta.drop_all() - @testing.exclude('mysql', '<', (4, 1, 0)) + @testing.exclude('mysql', '<', (4, 1, 0), '4.1+ syntax') def test_timestamp(self): """Exercise funky TIMESTAMP default syntax.""" @@ -579,7 +579,7 @@ class TypesTest(TestBase, AssertsExecutionResults): self.assert_eq(res, expected) enum_table.drop() - @testing.exclude('mysql', '>', (3)) + @testing.exclude('mysql', '<', (4,), "3.23 can't handle an ENUM of ''") def test_enum_parse(self): """More exercises for the ENUM type.""" @@ -626,7 +626,7 @@ class TypesTest(TestBase, AssertsExecutionResults): finally: def_table.drop() - @testing.exclude('mysql', '<', (5, 0, 0)) + @testing.exclude('mysql', '<', (5, 0, 0), 'early types are squirrely') @testing.uses_deprecated('Using String type with no length') def test_type_reflection(self): # (ask_for, roundtripped_as_if_different) diff --git a/test/dialect/postgres.py b/test/dialect/postgres.py index 3e5c200e4..83ca6c6f6 100644 --- a/test/dialect/postgres.py +++ b/test/dialect/postgres.py @@ -61,7 +61,7 @@ class CompileTest(TestBase, AssertsCompiledSQL): class ReturningTest(TestBase, AssertsExecutionResults): __only_on__ = 'postgres' - @testing.exclude('postgres', '<', (8, 2)) + @testing.exclude('postgres', '<', (8, 2), '8.3+ feature') def test_update_returning(self): meta = MetaData(testing.db) table = Table('tables', meta, @@ -81,7 +81,7 @@ class ReturningTest(TestBase, AssertsExecutionResults): finally: table.drop() - @testing.exclude('postgres', '<', (8, 2)) + @testing.exclude('postgres', '<', (8, 2), '8.3+ feature') def test_insert_returning(self): meta = MetaData(testing.db) table = Table('tables', meta, diff --git a/test/dialect/sqlite.py b/test/dialect/sqlite.py index 4cde5fc33..795146b09 100644 --- a/test/dialect/sqlite.py +++ b/test/dialect/sqlite.py @@ -197,7 +197,7 @@ class DialectTest(TestBase, AssertsExecutionResults): finally: cx.execute('DETACH DATABASE alt_schema') - @testing.exclude('sqlite', '<', (2, 6)) + @testing.exclude('sqlite', '<', (2, 6), 'no database support') def test_temp_table_reflection(self): cx = testing.db.connect() try: @@ -238,13 +238,13 @@ class InsertTest(TestBase, AssertsExecutionResults): finally: table.drop() - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_pk1(self): self._test_empty_insert( Table('a', MetaData(testing.db), Column('id', Integer, primary_key=True))) - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_pk2(self): self.assertRaises( exc.DBAPIError, @@ -253,7 +253,7 @@ class InsertTest(TestBase, AssertsExecutionResults): Column('x', Integer, primary_key=True), Column('y', Integer, primary_key=True))) - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_pk3(self): self.assertRaises( exc.DBAPIError, @@ -263,20 +263,20 @@ class InsertTest(TestBase, AssertsExecutionResults): Column('y', Integer, PassiveDefault('123'), primary_key=True))) - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_pk4(self): self._test_empty_insert( Table('d', MetaData(testing.db), Column('x', Integer, primary_key=True), Column('y', Integer, PassiveDefault('123')))) - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_nopk1(self): self._test_empty_insert( Table('e', MetaData(testing.db), Column('id', Integer))) - @testing.exclude('sqlite', '<', (3, 4)) + @testing.exclude('sqlite', '<', (3, 4), 'no database support') def test_empty_insert_nopk2(self): self._test_empty_insert( Table('f', MetaData(testing.db), -- cgit v1.2.1