From: Mike Bayer Date: Sun, 17 Jun 2012 00:10:30 +0000 (-0400) Subject: dbs like oracle can't handle these tests since we aren't applying a sequence X-Git-Tag: rel_0_8_0b1~378 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1bcff3af97f9b4dd17f9dcc3c2864fe21f98a25;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git dbs like oracle can't handle these tests since we aren't applying a sequence to the reflected table --- diff --git a/test/ext/test_declarative_reflection.py b/test/ext/test_declarative_reflection.py index a5f0df2b3c..a99c05af98 100644 --- a/test/ext/test_declarative_reflection.py +++ b/test/ext/test_declarative_reflection.py @@ -9,6 +9,8 @@ from sqlalchemy.orm import relationship, create_session, \ from test.lib import fixtures class DeclarativeReflectionBase(fixtures.TablesTest): + __requires__ = 'reflectable_autoincrement', + def setup(self): global Base Base = decl.declarative_base(testing.db) @@ -319,6 +321,7 @@ class DeferredInhReflectBase(DeferredReflectBase): ) class DeferredSingleInhReflectionTest(DeferredInhReflectBase): + @classmethod def define_tables(cls, metadata): Table("foo", metadata, diff --git a/test/lib/requires.py b/test/lib/requires.py index 9b9244eae2..88049d7fb2 100644 --- a/test/lib/requires.py +++ b/test/lib/requires.py @@ -74,6 +74,21 @@ def identity(fn): no_support('sybase', 'not supported by database'), ) +def reflectable_autoincrement(fn): + """Target database must support tables that can automatically generate + PKs assuming they were reflected. + + this is essentially all the DBs in "identity" plus Postgresql, which + has SERIAL support. FB and Oracle (and sybase?) require the Sequence to + be explicitly added, including if the table was reflected. + """ + return _chain_decorators_on( + fn, + no_support('firebird', 'not supported by database'), + no_support('oracle', 'not supported by database'), + no_support('sybase', 'not supported by database'), + ) + def independent_cursors(fn): """Target must support simultaneous, independent database cursors on a single connection."""