]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
dbs like oracle can't handle these tests since we aren't applying a sequence
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Jun 2012 00:10:30 +0000 (20:10 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Jun 2012 00:10:30 +0000 (20:10 -0400)
to the reflected table

test/ext/test_declarative_reflection.py
test/lib/requires.py

index a5f0df2b3cac80c37e8086b1163ed1eb63730ccc..a99c05af985f0571c22a592ae8031a4834963644 100644 (file)
@@ -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,
index 9b9244eae238fd0dc5526dc35bcee58f49db5b43..88049d7fb2f68304e74f5f77a2c08e17e6e3df69 100644 (file)
@@ -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."""