]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- move some requirements up to the testing module to better support running
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 13 Mar 2014 23:59:10 +0000 (19:59 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 13 Mar 2014 23:59:10 +0000 (19:59 -0400)
SQLA internal tests outside; plus things like savepoints, twophase

lib/sqlalchemy/testing/requirements.py
test/requirements.py

index 8591e7a1632d38557a78a86934a76d56f9641df5..7b2d0f40ae68a807ad885033494ecc8fcb0dd0ea 100644 (file)
@@ -494,6 +494,24 @@ class SuiteRequirements(Requirements):
 
         return exclusions.open()
 
+    @property
+    def selectone(self):
+        """target driver must support the literal statement 'select 1'"""
+        return exclusions.open()
+
+    @property
+    def savepoints(self):
+        """Target database must support savepoints."""
+
+        return exclusions.closed()
+
+    @property
+    def two_phase_transactions(self):
+        """Target database must support two-phase transactions."""
+
+        return exclusions.closed()
+
+
     @property
     def update_from(self):
         """Target must support UPDATE..FROM syntax"""
@@ -557,8 +575,44 @@ class SuiteRequirements(Requirements):
         """Catchall for a large variety of MySQL on Windows failures"""
         return exclusions.open()
 
+    @property
+    def ad_hoc_engines(self):
+        """Test environment must allow ad-hoc engine/connection creation.
+
+        DBs that scale poorly for many connections, even when closed, i.e.
+        Oracle, may use the "--low-connections" option which flags this requirement
+        as not present.
+
+        """
+        return exclusions.skip_if(lambda config: config.options.low_connections)
+
     def _has_mysql_on_windows(self, config):
         return False
 
     def _has_mysql_fully_case_sensitive(self, config):
         return False
+
+    @property
+    def sqlite(self):
+        return exclusions.skip_if(lambda: not self._has_sqlite())
+
+    @property
+    def cextensions(self):
+        return exclusions.skip_if(
+                lambda: not self._has_cextensions(), "C extensions not installed"
+                )
+
+    def _has_sqlite(self):
+        from sqlalchemy import create_engine
+        try:
+            create_engine('sqlite://')
+            return True
+        except ImportError:
+            return False
+
+    def _has_cextensions(self):
+        try:
+            from sqlalchemy import cresultproxy, cprocessors
+            return True
+        except ImportError:
+            return False
index 6726e49164b07020b22cd20ecaa5a05daddd9997..47bb9a7617b1d220053ac78533a46c2bcb86bdd2 100644 (file)
@@ -407,11 +407,6 @@ class DefaultRequirements(SuiteRequirements):
             "driver doesn't support 'sane' rowcount"
         )
 
-    @property
-    def cextensions(self):
-        return skip_if(
-                lambda: not self._has_cextensions(), "C extensions not installed"
-                )
 
     @property
     def emulated_lastrowid(self):
@@ -677,9 +672,6 @@ class DefaultRequirements(SuiteRequirements):
 
         return only_if(check_range_types)
 
-    @property
-    def sqlite(self):
-        return skip_if(lambda: not self._has_sqlite())
 
     @property
     def oracle_test_dblink(self):
@@ -708,16 +700,6 @@ class DefaultRequirements(SuiteRequirements):
                     ('mssql', None, None, 'only simple labels allowed')
                 ])
 
-    @property
-    def ad_hoc_engines(self):
-        """Test environment must allow ad-hoc engine/connection creation.
-
-        DBs that scale poorly for many connections, even when closed, i.e.
-        Oracle, may use the "--low-connections" option which flags this requirement
-        as not present.
-
-        """
-        return skip_if(lambda config: config.options.low_connections)
 
     @property
     def skip_mysql_on_windows(self):
@@ -744,20 +726,6 @@ class DefaultRequirements(SuiteRequirements):
         """target driver must support the literal statement 'select 1'"""
         return skip_if(["oracle", "firebird"], "non-standard SELECT scalar syntax")
 
-    def _has_cextensions(self):
-        try:
-            from sqlalchemy import cresultproxy, cprocessors
-            return True
-        except ImportError:
-            return False
-
-    def _has_sqlite(self):
-        from sqlalchemy import create_engine
-        try:
-            create_engine('sqlite://')
-            return True
-        except ImportError:
-            return False
 
     @property
     def mysql_fully_case_sensitive(self):