diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-13 19:59:10 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-13 19:59:10 -0400 |
| commit | 9c5c12fb230cc72bf5ae8573dc420007718eaf0a (patch) | |
| tree | 88b4d073d7878a4d95849dae7046bce67ccfc466 /lib/sqlalchemy/testing/requirements.py | |
| parent | 2057b86b2ac2cfcb354ac213fc997359089a3d4c (diff) | |
| download | sqlalchemy-9c5c12fb230cc72bf5ae8573dc420007718eaf0a.tar.gz | |
- move some requirements up to the testing module to better support running
SQLA internal tests outside; plus things like savepoints, twophase
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
| -rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 8591e7a16..7b2d0f40a 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -495,6 +495,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""" return exclusions.closed() @@ -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 |
