From b1bcff3af97f9b4dd17f9dcc3c2864fe21f98a25 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 16 Jun 2012 20:10:30 -0400 Subject: [PATCH] dbs like oracle can't handle these tests since we aren't applying a sequence to the reflected table --- test/ext/test_declarative_reflection.py | 3 +++ test/lib/requires.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+) 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.""" -- 2.47.3