Commits

Mike Bayer committed add43f6

- requirements

  • Participants
  • Parent commits 8ba03be

Comments (0)

Files changed (3)

File lib/sqlalchemy/testing/requirements.py

         return exclusions.open()
 
     @property
+    def foreign_keys(self):
+        """Target database must support foreign keys."""
+
+        return exclusions.open()
+
+    @property
+    def foreign_key_ddl(self):
+        """Target database must support the DDL phrases for FOREIGN KEY."""
+
+        return exclusions.open()
+
+    @property
     def autoincrement_insert(self):
         """target platform generates new surrogate integer primary key values
         when insert() is executed, excluding the pk column."""
         return self.schemas
 
     @property
-    def constraint_reflection(self):
+    def primary_key_constraint_reflection(self):
+        return exclusions.open()
+
+    @property
+    def foreign_key_constraint_reflection(self):
         return exclusions.open()
 
     @property

File lib/sqlalchemy/testing/schema.py

     test_opts = dict([(k, kw.pop(k)) for k in kw.keys()
                       if k.startswith('test_')])
 
+    if not config.requirements.foreign_key_ddl.enabled:
+        args = [arg for arg in args if not isinstance(arg, schema.ForeignKey)]
+
     col = schema.Column(*args, **kw)
     if 'test_needs_autoincrement' in test_opts and \
         kw.get('primary_key', False) and \

File lib/sqlalchemy/testing/suite/test_reflection.py

                     ])) > 0, '%s(%s), %s(%s)' % (col.name,
                             col.type, cols[i]['name'], ctype))
 
+    @testing.requires.table_reflection
     def test_get_columns(self):
         self._test_get_columns()
 
             eq_(addr_cons['name'], 'email_ad_pk')
         go()
 
+    @testing.requires.primary_key_constraint_reflection
     def test_get_pk_constraint(self):
         self._test_get_pk_constraint()
 
         eq_(fkey1['referred_columns'], ['user_id', ])
         eq_(fkey1['constrained_columns'], ['remote_user_id'])
 
-    @testing.requires.constraint_reflection
+    @testing.requires.foreign_key_constraint_reflection
     def test_get_foreign_keys(self):
         self._test_get_foreign_keys()
 
-    @testing.requires.constraint_reflection
+    @testing.requires.foreign_key_constraint_reflection
     @testing.requires.schemas
     def test_get_foreign_keys_with_schema(self):
         self._test_get_foreign_keys(schema='test_schema')