summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-03-24 11:33:53 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-03-24 11:33:53 -0400
commit2f150bee28525d49e7f36d2e0c7fbeda2352bc3a (patch)
tree677058b86afae6dd11308d21e71d170e0b0673b4 /test
parent87d7076b49ec52d6f890d1dc56f61ea2eb83f3a6 (diff)
downloadsqlalchemy-2f150bee28525d49e7f36d2e0c7fbeda2352bc3a.tar.gz
- rename __multiple__ to __backend__, and apply __backend__ to a large number of tests.
- move out logging tests from test_execute to test_logging
Diffstat (limited to 'test')
-rw-r--r--test/aaa_profiling/test_compiler.py1
-rw-r--r--test/aaa_profiling/test_memusage.py1
-rw-r--r--test/aaa_profiling/test_orm.py6
-rw-r--r--test/aaa_profiling/test_resultset.py3
-rw-r--r--test/engine/test_execute.py242
-rw-r--r--test/engine/test_logging.py255
-rw-r--r--test/engine/test_reflection.py10
-rw-r--r--test/engine/test_transaction.py8
-rw-r--r--test/orm/inheritance/test_polymorphic_rel.py1
-rw-r--r--test/orm/test_naturalpks.py7
-rw-r--r--test/orm/test_session.py13
-rw-r--r--test/orm/test_transaction.py14
-rw-r--r--test/orm/test_versioning.py7
-rw-r--r--test/sql/test_constraints.py2
-rw-r--r--test/sql/test_defaults.py15
-rw-r--r--test/sql/test_join_rewriting.py2
-rw-r--r--test/sql/test_query.py10
-rw-r--r--test/sql/test_quote.py27
-rw-r--r--test/sql/test_returning.py6
-rw-r--r--test/sql/test_rowcount.py1
-rw-r--r--test/sql/test_types.py1
-rw-r--r--test/sql/test_unicode.py1
-rw-r--r--test/sql/test_update.py3
23 files changed, 399 insertions, 237 deletions
diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py
index 8304296da..659f79664 100644
--- a/test/aaa_profiling/test_compiler.py
+++ b/test/aaa_profiling/test_compiler.py
@@ -4,6 +4,7 @@ from sqlalchemy.engine import default
class CompileTest(fixtures.TestBase, AssertsExecutionResults):
__requires__ = 'cpython',
+ __backend__ = True
@classmethod
def setup_class(cls):
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py
index 3766abb88..f9c853b89 100644
--- a/test/aaa_profiling/test_memusage.py
+++ b/test/aaa_profiling/test_memusage.py
@@ -84,6 +84,7 @@ class EnsureZeroed(fixtures.ORMTest):
class MemUsageTest(EnsureZeroed):
__requires__ = 'cpython',
+ __backend__ = True
# ensure a pure growing test trips the assertion
@testing.fails_if(lambda: True)
diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py
index 2c1e84afb..ff55b1c26 100644
--- a/test/aaa_profiling/test_orm.py
+++ b/test/aaa_profiling/test_orm.py
@@ -10,6 +10,7 @@ from sqlalchemy.testing.schema import Table, Column
import sys
class MergeTest(fixtures.MappedTest):
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -104,6 +105,7 @@ class LoadManyToOneFromIdentityTest(fixtures.MappedTest):
to load 1000 related objects from the identity map.
"""
+ __backend__ = True
@classmethod
@@ -258,6 +260,8 @@ class MergeBackrefsTest(fixtures.MappedTest):
s.merge(a)
class DeferOptionsTest(fixtures.MappedTest):
+ __backend__ = True
+
@classmethod
def define_tables(cls, metadata):
Table('a', metadata,
@@ -312,6 +316,8 @@ class DeferOptionsTest(fixtures.MappedTest):
class AttributeOverheadTest(fixtures.MappedTest):
+ __backend__ = True
+
@classmethod
def define_tables(cls, metadata):
Table('parent', metadata, Column('id', Integer,
diff --git a/test/aaa_profiling/test_resultset.py b/test/aaa_profiling/test_resultset.py
index d2f8c2256..a8b9f9d6f 100644
--- a/test/aaa_profiling/test_resultset.py
+++ b/test/aaa_profiling/test_resultset.py
@@ -11,6 +11,7 @@ NUM_RECORDS = 1000
class ResultSetTest(fixtures.TestBase, AssertsExecutionResults):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -55,6 +56,7 @@ class ResultSetTest(fixtures.TestBase, AssertsExecutionResults):
class ExecutionTest(fixtures.TestBase):
+ __backend__ = True
def test_minimal_connection_execute(self):
# create an engine without any instrumentation.
@@ -82,6 +84,7 @@ class ExecutionTest(fixtures.TestBase):
class RowProxyTest(fixtures.TestBase):
__requires__ = 'cpython',
+ __backend__ = True
def _rowproxy_fixture(self, keys, processors, row):
class MockMeta(object):
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index c2dbb4a3b..aad43c1df 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -24,6 +24,8 @@ from contextlib import contextmanager
users, metadata, users_autoinc = None, None, None
class ExecuteTest(fixtures.TestBase):
+ __backend__ = True
+
@classmethod
def setup_class(cls):
global users, users_autoinc, metadata
@@ -462,6 +464,8 @@ class ExecuteTest(fixtures.TestBase):
eng.dispose()
class ConvenienceExecuteTest(fixtures.TablesTest):
+ __backend__ = True
+
@classmethod
def define_tables(cls, metadata):
cls.table = Table('exec_test', metadata,
@@ -617,6 +621,8 @@ class ConvenienceExecuteTest(fixtures.TablesTest):
self._assert_no_data()
class CompiledCacheTest(fixtures.TestBase):
+ __backend__ = True
+
@classmethod
def setup_class(cls):
global users, metadata
@@ -648,240 +654,6 @@ class CompiledCacheTest(fixtures.TestBase):
assert len(cache) == 1
eq_(conn.execute("select count(*) from users").scalar(), 3)
-class LogParamsTest(fixtures.TestBase):
- __only_on__ = 'sqlite'
- __requires__ = 'ad_hoc_engines',
-
- def setup(self):
- self.eng = engines.testing_engine(options={'echo':True})
- self.eng.execute("create table foo (data string)")
- self.buf = logging.handlers.BufferingHandler(100)
- for log in [
- logging.getLogger('sqlalchemy.engine'),
- logging.getLogger('sqlalchemy.pool')
- ]:
- log.addHandler(self.buf)
-
- def teardown(self):
- self.eng.execute("drop table foo")
- for log in [
- logging.getLogger('sqlalchemy.engine'),
- logging.getLogger('sqlalchemy.pool')
- ]:
- log.removeHandler(self.buf)
-
- def test_log_large_dict(self):
- self.eng.execute(
- "INSERT INTO foo (data) values (:data)",
- [{"data":str(i)} for i in range(100)]
- )
- eq_(
- self.buf.buffer[1].message,
- "[{'data': '0'}, {'data': '1'}, {'data': '2'}, {'data': '3'}, "
- "{'data': '4'}, {'data': '5'}, {'data': '6'}, {'data': '7'}"
- " ... displaying 10 of 100 total bound "
- "parameter sets ... {'data': '98'}, {'data': '99'}]"
- )
-
- def test_log_large_list(self):
- self.eng.execute(
- "INSERT INTO foo (data) values (?)",
- [(str(i), ) for i in range(100)]
- )
- eq_(
- self.buf.buffer[1].message,
- "[('0',), ('1',), ('2',), ('3',), ('4',), ('5',), "
- "('6',), ('7',) ... displaying 10 of 100 total "
- "bound parameter sets ... ('98',), ('99',)]"
- )
-
- def test_error_large_dict(self):
- assert_raises_message(
- tsa.exc.DBAPIError,
- r".*'INSERT INTO nonexistent \(data\) values \(:data\)' "
- "\[{'data': '0'}, {'data': '1'}, {'data': '2'}, "
- "{'data': '3'}, {'data': '4'}, {'data': '5'}, "
- "{'data': '6'}, {'data': '7'} ... displaying 10 of "
- "100 total bound parameter sets ... {'data': '98'}, {'data': '99'}\]",
- lambda: self.eng.execute(
- "INSERT INTO nonexistent (data) values (:data)",
- [{"data":str(i)} for i in range(100)]
- )
- )
-
- def test_error_large_list(self):
- assert_raises_message(
- tsa.exc.DBAPIError,
- r".*INSERT INTO nonexistent \(data\) values "
- "\(\?\)' \[\('0',\), \('1',\), \('2',\), \('3',\), "
- "\('4',\), \('5',\), \('6',\), \('7',\) ... displaying "
- "10 of 100 total bound parameter sets ... "
- "\('98',\), \('99',\)\]",
- lambda: self.eng.execute(
- "INSERT INTO nonexistent (data) values (?)",
- [(str(i), ) for i in range(100)]
- )
- )
-
-class LoggingNameTest(fixtures.TestBase):
- __requires__ = 'ad_hoc_engines',
-
- def _assert_names_in_execute(self, eng, eng_name, pool_name):
- eng.execute(select([1]))
- assert self.buf.buffer
- for name in [b.name for b in self.buf.buffer]:
- assert name in (
- 'sqlalchemy.engine.base.Engine.%s' % eng_name,
- 'sqlalchemy.pool.%s.%s' %
- (eng.pool.__class__.__name__, pool_name)
- )
-
- def _assert_no_name_in_execute(self, eng):
- eng.execute(select([1]))
- assert self.buf.buffer
- for name in [b.name for b in self.buf.buffer]:
- assert name in (
- 'sqlalchemy.engine.base.Engine',
- 'sqlalchemy.pool.%s' % eng.pool.__class__.__name__
- )
-
- def _named_engine(self, **kw):
- options = {
- 'logging_name':'myenginename',
- 'pool_logging_name':'mypoolname',
- 'echo':True
- }
- options.update(kw)
- return engines.testing_engine(options=options)
-
- def _unnamed_engine(self, **kw):
- kw.update({'echo':True})
- return engines.testing_engine(options=kw)
-
- def setup(self):
- self.buf = logging.handlers.BufferingHandler(100)
- for log in [
- logging.getLogger('sqlalchemy.engine'),
- logging.getLogger('sqlalchemy.pool')
- ]:
- log.addHandler(self.buf)
-
- def teardown(self):
- for log in [
- logging.getLogger('sqlalchemy.engine'),
- logging.getLogger('sqlalchemy.pool')
- ]:
- log.removeHandler(self.buf)
-
- def test_named_logger_names(self):
- eng = self._named_engine()
- eq_(eng.logging_name, "myenginename")
- eq_(eng.pool.logging_name, "mypoolname")
-
- def test_named_logger_names_after_dispose(self):
- eng = self._named_engine()
- eng.execute(select([1]))
- eng.dispose()
- eq_(eng.logging_name, "myenginename")
- eq_(eng.pool.logging_name, "mypoolname")
-
- def test_unnamed_logger_names(self):
- eng = self._unnamed_engine()
- eq_(eng.logging_name, None)
- eq_(eng.pool.logging_name, None)
-
- def test_named_logger_execute(self):
- eng = self._named_engine()
- self._assert_names_in_execute(eng, "myenginename", "mypoolname")
-
- def test_named_logger_echoflags_execute(self):
- eng = self._named_engine(echo='debug', echo_pool='debug')
- self._assert_names_in_execute(eng, "myenginename", "mypoolname")
-
- def test_named_logger_execute_after_dispose(self):
- eng = self._named_engine()
- eng.execute(select([1]))
- eng.dispose()
- self._assert_names_in_execute(eng, "myenginename", "mypoolname")
-
- def test_unnamed_logger_execute(self):
- eng = self._unnamed_engine()
- self._assert_no_name_in_execute(eng)
-
- def test_unnamed_logger_echoflags_execute(self):
- eng = self._unnamed_engine(echo='debug', echo_pool='debug')
- self._assert_no_name_in_execute(eng)
-
-class EchoTest(fixtures.TestBase):
- __requires__ = 'ad_hoc_engines',
-
- def setup(self):
- self.level = logging.getLogger('sqlalchemy.engine').level
- logging.getLogger('sqlalchemy.engine').setLevel(logging.WARN)
- self.buf = logging.handlers.BufferingHandler(100)
- logging.getLogger('sqlalchemy.engine').addHandler(self.buf)
-
- def teardown(self):
- logging.getLogger('sqlalchemy.engine').removeHandler(self.buf)
- logging.getLogger('sqlalchemy.engine').setLevel(self.level)
-
- def testing_engine(self):
- e = engines.testing_engine()
-
- # do an initial execute to clear out 'first connect'
- # messages
- e.execute(select([10])).close()
- self.buf.flush()
-
- return e
-
- def test_levels(self):
- e1 = engines.testing_engine()
-
- eq_(e1._should_log_info(), False)
- eq_(e1._should_log_debug(), False)
- eq_(e1.logger.isEnabledFor(logging.INFO), False)
- eq_(e1.logger.getEffectiveLevel(), logging.WARN)
-
- e1.echo = True
- eq_(e1._should_log_info(), True)
- eq_(e1._should_log_debug(), False)
- eq_(e1.logger.isEnabledFor(logging.INFO), True)
- eq_(e1.logger.getEffectiveLevel(), logging.INFO)
-
- e1.echo = 'debug'
- eq_(e1._should_log_info(), True)
- eq_(e1._should_log_debug(), True)
- eq_(e1.logger.isEnabledFor(logging.DEBUG), True)
- eq_(e1.logger.getEffectiveLevel(), logging.DEBUG)
-
- e1.echo = False
- eq_(e1._should_log_info(), False)
- eq_(e1._should_log_debug(), False)
- eq_(e1.logger.isEnabledFor(logging.INFO), False)
- eq_(e1.logger.getEffectiveLevel(), logging.WARN)
-
- def test_echo_flag_independence(self):
- """test the echo flag's independence to a specific engine."""
-
- e1 = self.testing_engine()
- e2 = self.testing_engine()
-
- e1.echo = True
- e1.execute(select([1])).close()
- e2.execute(select([2])).close()
-
- e1.echo = False
- e1.execute(select([3])).close()
- e2.execute(select([4])).close()
-
- e2.echo = True
- e1.execute(select([5])).close()
- e2.execute(select([6])).close()
-
- assert self.buf.buffer[0].getMessage().startswith("SELECT 1")
- assert self.buf.buffer[2].getMessage().startswith("SELECT 6")
- assert len(self.buf.buffer) == 4
class MockStrategyTest(fixtures.TestBase):
def _engine_fixture(self):
@@ -912,6 +684,7 @@ class MockStrategyTest(fixtures.TestBase):
)
class ResultProxyTest(fixtures.TestBase):
+ __backend__ = True
def test_nontuple_row(self):
"""ensure the C version of BaseRowProxy handles
@@ -1171,6 +944,7 @@ class AlternateResultProxyTest(fixtures.TestBase):
class EngineEventsTest(fixtures.TestBase):
__requires__ = 'ad_hoc_engines',
+ __backend__ = True
def tearDown(self):
Engine.dispatch._clear()
diff --git a/test/engine/test_logging.py b/test/engine/test_logging.py
new file mode 100644
index 000000000..94ea22813
--- /dev/null
+++ b/test/engine/test_logging.py
@@ -0,0 +1,255 @@
+from sqlalchemy.testing import eq_, assert_raises, assert_raises_message, \
+ config, is_
+import re
+from sqlalchemy.testing.util import picklers
+from sqlalchemy.interfaces import ConnectionProxy
+from sqlalchemy import MetaData, Integer, String, INT, VARCHAR, func, \
+ bindparam, select, event, TypeDecorator, create_engine, Sequence
+from sqlalchemy.sql import column, literal
+from sqlalchemy.testing.schema import Table, Column
+import sqlalchemy as tsa
+from sqlalchemy import testing
+from sqlalchemy.testing import engines
+from sqlalchemy import util
+from sqlalchemy.testing.engines import testing_engine
+import logging.handlers
+from sqlalchemy.dialects.oracle.zxjdbc import ReturningParam
+from sqlalchemy.engine import result as _result, default
+from sqlalchemy.engine.base import Engine
+from sqlalchemy.testing import fixtures
+from sqlalchemy.testing.mock import Mock, call, patch
+
+class LogParamsTest(fixtures.TestBase):
+ __only_on__ = 'sqlite'
+ __requires__ = 'ad_hoc_engines',
+
+ def setup(self):
+ self.eng = engines.testing_engine(options={'echo':True})
+ self.eng.execute("create table foo (data string)")
+ self.buf = logging.handlers.BufferingHandler(100)
+ for log in [
+ logging.getLogger('sqlalchemy.engine'),
+ logging.getLogger('sqlalchemy.pool')
+ ]:
+ log.addHandler(self.buf)
+
+ def teardown(self):
+ self.eng.execute("drop table foo")
+ for log in [
+ logging.getLogger('sqlalchemy.engine'),
+ logging.getLogger('sqlalchemy.pool')
+ ]:
+ log.removeHandler(self.buf)
+
+ def test_log_large_dict(self):
+ self.eng.execute(
+ "INSERT INTO foo (data) values (:data)",
+ [{"data":str(i)} for i in range(100)]
+ )
+ eq_(
+ self.buf.buffer[1].message,
+ "[{'data': '0'}, {'data': '1'}, {'data': '2'}, {'data': '3'}, "
+ "{'data': '4'}, {'data': '5'}, {'data': '6'}, {'data': '7'}"
+ " ... displaying 10 of 100 total bound "
+ "parameter sets ... {'data': '98'}, {'data': '99'}]"
+ )
+
+ def test_log_large_list(self):
+ self.eng.execute(
+ "INSERT INTO foo (data) values (?)",
+ [(str(i), ) for i in range(100)]
+ )
+ eq_(
+ self.buf.buffer[1].message,
+ "[('0',), ('1',), ('2',), ('3',), ('4',), ('5',), "
+ "('6',), ('7',) ... displaying 10 of 100 total "
+ "bound parameter sets ... ('98',), ('99',)]"
+ )
+
+ def test_error_large_dict(self):
+ assert_raises_message(
+ tsa.exc.DBAPIError,
+ r".*'INSERT INTO nonexistent \(data\) values \(:data\)' "
+ "\[{'data': '0'}, {'data': '1'}, {'data': '2'}, "
+ "{'data': '3'}, {'data': '4'}, {'data': '5'}, "
+ "{'data': '6'}, {'data': '7'} ... displaying 10 of "
+ "100 total bound parameter sets ... {'data': '98'}, {'data': '99'}\]",
+ lambda: self.eng.execute(
+ "INSERT INTO nonexistent (data) values (:data)",
+ [{"data":str(i)} for i in range(100)]
+ )
+ )
+
+ def test_error_large_list(self):
+ assert_raises_message(
+ tsa.exc.DBAPIError,
+ r".*INSERT INTO nonexistent \(data\) values "
+ "\(\?\)' \[\('0',\), \('1',\), \('2',\), \('3',\), "
+ "\('4',\), \('5',\), \('6',\), \('7',\) ... displaying "
+ "10 of 100 total bound parameter sets ... "
+ "\('98',\), \('99',\)\]",
+ lambda: self.eng.execute(
+ "INSERT INTO nonexistent (data) values (?)",
+ [(str(i), ) for i in range(100)]
+ )
+ )
+
+class LoggingNameTest(fixtures.TestBase):
+ __requires__ = 'ad_hoc_engines',
+
+ def _assert_names_in_execute(self, eng, eng_name, pool_name):
+ eng.execute(select([1]))
+ assert self.buf.buffer
+ for name in [b.name for b in self.buf.buffer]:
+ assert name in (
+ 'sqlalchemy.engine.base.Engine.%s' % eng_name,
+ 'sqlalchemy.pool.%s.%s' %
+ (eng.pool.__class__.__name__, pool_name)
+ )
+
+ def _assert_no_name_in_execute(self, eng):
+ eng.execute(select([1]))
+ assert self.buf.buffer
+ for name in [b.name for b in self.buf.buffer]:
+ assert name in (
+ 'sqlalchemy.engine.base.Engine',
+ 'sqlalchemy.pool.%s' % eng.pool.__class__.__name__
+ )
+
+ def _named_engine(self, **kw):
+ options = {
+ 'logging_name':'myenginename',
+ 'pool_logging_name':'mypoolname',
+ 'echo':True
+ }
+ options.update(kw)
+ return engines.testing_engine(options=options)
+
+ def _unnamed_engine(self, **kw):
+ kw.update({'echo':True})
+ return engines.testing_engine(options=kw)
+
+ def setup(self):
+ self.buf = logging.handlers.BufferingHandler(100)
+ for log in [
+ logging.getLogger('sqlalchemy.engine'),
+ logging.getLogger('sqlalchemy.pool')
+ ]:
+ log.addHandler(self.buf)
+
+ def teardown(self):
+ for log in [
+ logging.getLogger('sqlalchemy.engine'),
+ logging.getLogger('sqlalchemy.pool')
+ ]:
+ log.removeHandler(self.buf)
+
+ def test_named_logger_names(self):
+ eng = self._named_engine()
+ eq_(eng.logging_name, "myenginename")
+ eq_(eng.pool.logging_name, "mypoolname")
+
+ def test_named_logger_names_after_dispose(self):
+ eng = self._named_engine()
+ eng.execute(select([1]))
+ eng.dispose()
+ eq_(eng.logging_name, "myenginename")
+ eq_(eng.pool.logging_name, "mypoolname")
+
+ def test_unnamed_logger_names(self):
+ eng = self._unnamed_engine()
+ eq_(eng.logging_name, None)
+ eq_(eng.pool.logging_name, None)
+
+ def test_named_logger_execute(self):
+ eng = self._named_engine()
+ self._assert_names_in_execute(eng, "myenginename", "mypoolname")
+
+ def test_named_logger_echoflags_execute(self):
+ eng = self._named_engine(echo='debug', echo_pool='debug')
+ self._assert_names_in_execute(eng, "myenginename", "mypoolname")
+
+ def test_named_logger_execute_after_dispose(self):
+ eng = self._named_engine()
+ eng.execute(select([1]))
+ eng.dispose()
+ self._assert_names_in_execute(eng, "myenginename", "mypoolname")
+
+ def test_unnamed_logger_execute(self):
+ eng = self._unnamed_engine()
+ self._assert_no_name_in_execute(eng)
+
+ def test_unnamed_logger_echoflags_execute(self):
+ eng = self._unnamed_engine(echo='debug', echo_pool='debug')
+ self._assert_no_name_in_execute(eng)
+
+class EchoTest(fixtures.TestBase):
+ __requires__ = 'ad_hoc_engines',
+
+ def setup(self):
+ self.level = logging.getLogger('sqlalchemy.engine').level
+ logging.getLogger('sqlalchemy.engine').setLevel(logging.WARN)
+ self.buf = logging.handlers.BufferingHandler(100)
+ logging.getLogger('sqlalchemy.engine').addHandler(self.buf)
+
+ def teardown(self):
+ logging.getLogger('sqlalchemy.engine').removeHandler(self.buf)
+ logging.getLogger('sqlalchemy.engine').setLevel(self.level)
+
+ def testing_engine(self):
+ e = engines.testing_engine()
+
+ # do an initial execute to clear out 'first connect'
+ # messages
+ e.execute(select([10])).close()
+ self.buf.flush()
+
+ return e
+
+ def test_levels(self):
+ e1 = engines.testing_engine()
+
+ eq_(e1._should_log_info(), False)
+ eq_(e1._should_log_debug(), False)
+ eq_(e1.logger.isEnabledFor(logging.INFO), False)
+ eq_(e1.logger.getEffectiveLevel(), logging.WARN)
+
+ e1.echo = True
+ eq_(e1._should_log_info(), True)
+ eq_(e1._should_log_debug(), False)
+ eq_(e1.logger.isEnabledFor(logging.INFO), True)
+ eq_(e1.logger.getEffectiveLevel(), logging.INFO)
+
+ e1.echo = 'debug'
+ eq_(e1._should_log_info(), True)
+ eq_(e1._should_log_debug(), True)
+ eq_(e1.logger.isEnabledFor(logging.DEBUG), True)
+ eq_(e1.logger.getEffectiveLevel(), logging.DEBUG)
+
+ e1.echo = False
+ eq_(e1._should_log_info(), False)
+ eq_(e1._should_log_debug(), False)
+ eq_(e1.logger.isEnabledFor(logging.INFO), False)
+ eq_(e1.logger.getEffectiveLevel(), logging.WARN)
+
+ def test_echo_flag_independence(self):
+ """test the echo flag's independence to a specific engine."""
+
+ e1 = self.testing_engine()
+ e2 = self.testing_engine()
+
+ e1.echo = True
+ e1.execute(select([1])).close()
+ e2.execute(select([2])).close()
+
+ e1.echo = False
+ e1.execute(select([3])).close()
+ e2.execute(select([4])).close()
+
+ e2.echo = True
+ e1.execute(select([5])).close()
+ e2.execute(select([6])).close()
+
+ assert self.buf.buffer[0].getMessage().startswith("SELECT 1")
+ assert self.buf.buffer[2].getMessage().startswith("SELECT 6")
+ assert len(self.buf.buffer) == 4
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index a53893549..1db37851d 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -15,6 +15,7 @@ from sqlalchemy.util import ue
metadata, users = None, None
class ReflectionTest(fixtures.TestBase, ComparesTables):
+ __backend__ = True
@testing.exclude('mssql', '<', (10, 0, 0),
'Date is only supported on MSSQL 2008+')
@@ -1016,6 +1017,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
_drop_views(metadata.bind)
class CreateDropTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1103,6 +1105,8 @@ class CreateDropTest(fixtures.TestBase):
metadata.drop_all(bind=testing.db)
class SchemaManipulationTest(fixtures.TestBase):
+ __backend__ = True
+
def test_append_constraint_unique(self):
meta = MetaData()
@@ -1119,6 +1123,8 @@ class SchemaManipulationTest(fixtures.TestBase):
assert addresses.constraints == set([addresses.primary_key, fk])
class UnicodeReflectionTest(fixtures.TestBase):
+ __backend__ = True
+
@classmethod
def setup_class(cls):
cls.metadata = metadata = MetaData()
@@ -1226,6 +1232,7 @@ class UnicodeReflectionTest(fixtures.TestBase):
)
class SchemaTest(fixtures.TestBase):
+ __backend__ = True
@testing.requires.schemas
@testing.requires.cross_schema_fk_reflection
@@ -1430,6 +1437,7 @@ def _drop_views(con, schema=None):
class ReverseCasingReflectTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = 'default'
+ __backend__ = True
@testing.requires.denormalized_names
def setup(self):
@@ -1456,6 +1464,7 @@ class ReverseCasingReflectTest(fixtures.TestBase, AssertsCompiledSQL):
class CaseSensitiveTest(fixtures.TablesTest):
"""Nail down case sensitive behaviors, mostly on MySQL."""
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -1502,6 +1511,7 @@ class CaseSensitiveTest(fixtures.TablesTest):
class ColumnEventsTest(fixtures.RemovesEvents, fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index c373133d1..ee626a50e 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -15,6 +15,8 @@ from sqlalchemy.testing import fixtures
users, metadata = None, None
class TransactionTest(fixtures.TestBase):
+ __backend__ = True
+
@classmethod
def setup_class(cls):
global users, metadata
@@ -412,6 +414,8 @@ class TransactionTest(fixtures.TestBase):
eq_(result.fetchall(), [])
class ResetAgentTest(fixtures.TestBase):
+ __backend__ = True
+
def test_begin_close(self):
with testing.db.connect() as connection:
trans = connection.begin()
@@ -513,6 +517,7 @@ class ResetAgentTest(fixtures.TestBase):
assert connection.connection._reset_agent is None
class AutoRollbackTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -678,6 +683,7 @@ tlengine = None
class TLTransactionTest(fixtures.TestBase):
__requires__ = ('ad_hoc_engines', )
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1124,6 +1130,7 @@ counters = None
class ForUpdateTest(fixtures.TestBase):
__requires__ = 'ad_hoc_engines',
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1254,6 +1261,7 @@ class ForUpdateTest(fixtures.TestBase):
class IsolationLevelTest(fixtures.TestBase):
__requires__ = ('isolation_level', 'ad_hoc_engines')
+ __backend__ = True
def _default_isolation_level(self):
if testing.against('sqlite'):
diff --git a/test/orm/inheritance/test_polymorphic_rel.py b/test/orm/inheritance/test_polymorphic_rel.py
index be3731fad..29fbcff85 100644
--- a/test/orm/inheritance/test_polymorphic_rel.py
+++ b/test/orm/inheritance/test_polymorphic_rel.py
@@ -13,6 +13,7 @@ from ._poly_fixtures import Company, Person, Engineer, Manager, Boss, \
_PolymorphicAliasedJoins
class _PolymorphicTestBase(object):
+ __backend__ = True
@classmethod
def setup_mappers(cls):
diff --git a/test/orm/test_naturalpks.py b/test/orm/test_naturalpks.py
index a4663217f..1bb536d70 100644
--- a/test/orm/test_naturalpks.py
+++ b/test/orm/test_naturalpks.py
@@ -28,6 +28,7 @@ class NaturalPKTest(fixtures.MappedTest):
# MySQL 5.5 on Windows crashes (the entire server, not the client)
# if you screw around with ON UPDATE CASCADE type of stuff.
__requires__ = 'skip_mysql_on_windows', 'on_update_or_deferrable_fks'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -453,6 +454,7 @@ class NaturalPKTest(fixtures.MappedTest):
class TransientExceptionTesst(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def test_transient_exception(self):
"""An object that goes from a pk value to transient/pending
@@ -492,6 +494,7 @@ class ReversePKsTest(fixtures.MappedTest):
"""reverse the primary keys of two entities and ensure bookkeeping
succeeds."""
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -553,6 +556,7 @@ class SelfReferentialTest(fixtures.MappedTest):
__unsupported_on__ = ('mssql', 'mysql')
__requires__ = 'on_update_or_deferrable_fks',
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -657,6 +661,7 @@ class SelfReferentialTest(fixtures.MappedTest):
class NonPKCascadeTest(fixtures.MappedTest):
__requires__ = 'skip_mysql_on_windows', 'on_update_or_deferrable_fks'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -762,6 +767,7 @@ class NonPKCascadeTest(fixtures.MappedTest):
class CascadeToFKPKTest(fixtures.MappedTest, testing.AssertsCompiledSQL):
"""A primary key mutation cascades onto a foreign key that is itself a
primary key."""
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -1016,6 +1022,7 @@ class JoinedInheritanceTest(fixtures.MappedTest):
__unsupported_on__ = ('mssql',)
__requires__ = 'skip_mysql_on_windows',
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
diff --git a/test/orm/test_session.py b/test/orm/test_session.py
index 4eb498ee9..de5473470 100644
--- a/test/orm/test_session.py
+++ b/test/orm/test_session.py
@@ -20,6 +20,7 @@ from sqlalchemy import event, ForeignKey
class BindTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def test_mapped_binds(self):
Address, addresses, users, User = (self.classes.Address,
@@ -209,6 +210,7 @@ class BindTest(_fixtures.FixtureTest):
class ExecutionTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
@testing.requires.sequences
def test_sequence_execute(self):
@@ -258,6 +260,7 @@ class ExecutionTest(_fixtures.FixtureTest):
class TransScopingTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def test_no_close_on_flush(self):
"""Flush() doesn't close a connection the session didn't open"""
@@ -313,6 +316,7 @@ class TransScopingTest(_fixtures.FixtureTest):
class SessionUtilTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def test_object_session_raises(self):
User = self.classes.User
@@ -393,6 +397,7 @@ class SessionUtilTest(_fixtures.FixtureTest):
class SessionStateTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def test_info(self):
@@ -822,6 +827,7 @@ class SessionStateTest(_fixtures.FixtureTest):
assert object_session(u1) is None
class SessionStateWFixtureTest(_fixtures.FixtureTest):
+ __backend__ = True
def test_autoflush_rollback(self):
Address, addresses, users, User = (self.classes.Address,
@@ -884,6 +890,7 @@ class NoCyclesOnTransientDetachedTest(_fixtures.FixtureTest):
"""
run_inserts = None
+ __backend__ = True
def setup(self):
mapper(self.classes.User, self.tables.users)
@@ -1024,6 +1031,7 @@ class NoCyclesOnTransientDetachedTest(_fixtures.FixtureTest):
class WeakIdentityMapTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
@testing.requires.predictable_gc
def test_weakref(self):
@@ -1194,6 +1202,7 @@ class WeakIdentityMapTest(_fixtures.FixtureTest):
class StrongIdentityMapTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
@testing.uses_deprecated()
def test_strong_ref(self):
@@ -1274,6 +1283,7 @@ class StrongIdentityMapTest(_fixtures.FixtureTest):
class IsModifiedTest(_fixtures.FixtureTest):
run_inserts = None
+ __backend__ = True
def _default_mapping_fixture(self):
User, Address = self.classes.User, self.classes.Address
@@ -1387,6 +1397,7 @@ class DisposedStates(fixtures.MappedTest):
run_setup_mappers = 'once'
run_inserts = 'once'
run_deletes = None
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -1600,6 +1611,7 @@ class SessionInterface(fixtures.TestBase):
class TLTransactionTest(fixtures.MappedTest):
run_dispose_bind = 'once'
+ __backend__ = True
@classmethod
def setup_bind(cls):
@@ -1637,6 +1649,7 @@ class TLTransactionTest(fixtures.MappedTest):
class FlushWarningsTest(fixtures.MappedTest):
run_setup_mappers = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
diff --git a/test/orm/test_transaction.py b/test/orm/test_transaction.py
index 2866ab4ab..22d759bb8 100644
--- a/test/orm/test_transaction.py
+++ b/test/orm/test_transaction.py
@@ -15,6 +15,7 @@ from test.orm._fixtures import FixtureTest
class SessionTransactionTest(FixtureTest):
run_inserts = None
+ __backend__ = True
def test_no_close_transaction_on_flush(self):
User, users = self.classes.User, self.tables.users
@@ -539,6 +540,7 @@ class _LocalFixture(FixtureTest):
class FixtureDataTest(_LocalFixture):
run_inserts = 'each'
+ __backend__ = True
def test_attrs_on_rollback(self):
User = self.classes.User
@@ -578,6 +580,7 @@ class CleanSavepointTest(FixtureTest):
"""
run_inserts = None
+ __backend__ = True
def _run_test(self, update_fn):
User, users = self.classes.User, self.tables.users
@@ -624,6 +627,7 @@ class CleanSavepointTest(FixtureTest):
class ContextManagerTest(FixtureTest):
run_inserts = None
+ __backend__ = True
@testing.requires.savepoints
@engines.close_open_connections
@@ -683,6 +687,7 @@ class ContextManagerTest(FixtureTest):
class AutoExpireTest(_LocalFixture):
+ __backend__ = True
def test_expunge_pending_on_rollback(self):
User = self.classes.User
@@ -825,6 +830,7 @@ class AutoExpireTest(_LocalFixture):
assert u1.name == 'will'
class TwoPhaseTest(_LocalFixture):
+ __backend__ = True
@testing.requires.two_phase_transactions
def test_rollback_on_prepare(self):
@@ -839,6 +845,7 @@ class TwoPhaseTest(_LocalFixture):
assert u not in s
class RollbackRecoverTest(_LocalFixture):
+ __backend__ = True
def test_pk_violation(self):
User, Address = self.classes.User, self.classes.Address
@@ -905,6 +912,7 @@ class RollbackRecoverTest(_LocalFixture):
class SavepointTest(_LocalFixture):
+ __backend__ = True
@testing.requires.savepoints
def test_savepoint_rollback(self):
@@ -1073,6 +1081,8 @@ class SavepointTest(_LocalFixture):
class AccountingFlagsTest(_LocalFixture):
+ __backend__ = True
+
def test_no_expire_on_commit(self):
User, users = self.classes.User, self.tables.users
@@ -1147,6 +1157,8 @@ class AccountingFlagsTest(_LocalFixture):
class AutoCommitTest(_LocalFixture):
+ __backend__ = True
+
def test_begin_nested_requires_trans(self):
sess = create_session(autocommit=True)
assert_raises(sa_exc.InvalidRequestError, sess.begin_nested)
@@ -1248,6 +1260,8 @@ class AutoCommitTest(_LocalFixture):
eq_(u1.id, 3)
class NaturalPKRollbackTest(fixtures.MappedTest):
+ __backend__ = True
+
@classmethod
def define_tables(cls, metadata):
Table('users', metadata,
diff --git a/test/orm/test_versioning.py b/test/orm/test_versioning.py
index 9379543ed..3519d2c42 100644
--- a/test/orm/test_versioning.py
+++ b/test/orm/test_versioning.py
@@ -36,6 +36,7 @@ def make_uuid():
return _uuids.pop(0)
class VersioningTest(fixtures.MappedTest):
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -326,6 +327,7 @@ class VersioningTest(fixtures.MappedTest):
)
class ColumnTypeTest(fixtures.MappedTest):
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -366,6 +368,7 @@ class ColumnTypeTest(fixtures.MappedTest):
s1.commit()
class RowSwitchTest(fixtures.MappedTest):
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
Table('p', metadata,
@@ -433,6 +436,7 @@ class RowSwitchTest(fixtures.MappedTest):
session.commit()
class AlternateGeneratorTest(fixtures.MappedTest):
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
Table('p', metadata,
@@ -544,6 +548,7 @@ class InheritanceTwoVersionIdsTest(fixtures.MappedTest):
versioning column.
"""
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
Table('base', metadata,
@@ -647,6 +652,7 @@ class InheritanceTwoVersionIdsTest(fixtures.MappedTest):
class ServerVersioningTest(fixtures.MappedTest):
run_define_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -831,6 +837,7 @@ class ServerVersioningTest(fixtures.MappedTest):
class ManualVersionTest(fixtures.MappedTest):
run_define_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py
index cb4b73ec8..b174ef3c1 100644
--- a/test/sql/test_constraints.py
+++ b/test/sql/test_constraints.py
@@ -14,6 +14,8 @@ from sqlalchemy.sql import table, column
class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
__dialect__ = 'default'
+ __backend__ = True
+
@testing.provide_metadata
def test_pk_fk_constraint_create(self):
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py
index 1622c4ed8..ba6166ea6 100644
--- a/test/sql/test_defaults.py
+++ b/test/sql/test_defaults.py
@@ -19,6 +19,7 @@ t = f = f2 = ts = currenttime = metadata = default_generator = None
t = f = f2 = ts = currenttime = metadata = default_generator = None
class DefaultTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -418,6 +419,7 @@ class DefaultTest(fixtures.TestBase):
class PKDefaultTest(fixtures.TablesTest):
__requires__ = ('subqueries',)
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -454,6 +456,7 @@ class PKDefaultTest(fixtures.TablesTest):
class PKIncrementTest(fixtures.TablesTest):
run_define_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -520,6 +523,8 @@ class PKIncrementTest(fixtures.TablesTest):
class EmptyInsertTest(fixtures.TestBase):
+ __backend__ = True
+
@testing.exclude('sqlite', '<', (3, 3, 8), 'no empty insert support')
@testing.fails_on('oracle', 'FIXME: unknown')
@testing.provide_metadata
@@ -534,6 +539,7 @@ class EmptyInsertTest(fixtures.TestBase):
class AutoIncrementTest(fixtures.TablesTest):
__requires__ = ('identity',)
run_define_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -644,6 +650,7 @@ class AutoIncrementTest(fixtures.TablesTest):
class SequenceDDLTest(fixtures.TestBase, testing.AssertsCompiledSQL):
__dialect__ = 'default'
+ __backend__ = True
def test_create_drop_ddl(self):
self.assert_compile(
@@ -673,6 +680,7 @@ class SequenceDDLTest(fixtures.TestBase, testing.AssertsCompiledSQL):
class SequenceExecTest(fixtures.TestBase):
__requires__ = ('sequences',)
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -804,6 +812,7 @@ class SequenceExecTest(fixtures.TestBase):
class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL):
__requires__ = ('sequences',)
+ __backend__ = True
@testing.fails_on('firebird', 'no FB support for start/increment')
def test_start_increment(self):
@@ -918,6 +927,7 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL):
cartitems = sometable = metadata = None
class TableBoundSequenceTest(fixtures.TestBase):
__requires__ = ('sequences',)
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -985,6 +995,7 @@ class SpecialTypePKTest(fixtures.TestBase):
rather than the class of "type" itself.
"""
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1065,6 +1076,8 @@ class SpecialTypePKTest(fixtures.TestBase):
self._run_test(server_default='1', autoincrement=False)
class ServerDefaultsOnPKTest(fixtures.TestBase):
+ __backend__ = True
+
@testing.provide_metadata
def test_string_default_none_on_insert(self):
"""Test that without implicit returning, we return None for
@@ -1193,6 +1206,8 @@ class ServerDefaultsOnPKTest(fixtures.TestBase):
)
class UnicodeDefaultsTest(fixtures.TestBase):
+ __backend__ = True
+
def test_no_default(self):
Column(Unicode(32))
diff --git a/test/sql/test_join_rewriting.py b/test/sql/test_join_rewriting.py
index 6fb108a27..35797871a 100644
--- a/test/sql/test_join_rewriting.py
+++ b/test/sql/test_join_rewriting.py
@@ -509,6 +509,8 @@ class JoinNoUseLabelsTest(_JoinRewriteTestBase, fixtures.TestBase):
class JoinExecTest(_JoinRewriteTestBase, fixtures.TestBase):
"""invoke the SQL on the current backend to ensure compatibility"""
+ __backend__ = True
+
_a_bc = _a_bc_comma_a1_selbc = _a__b_dc = _a_bkeyassoc = \
_a_bkeyassoc_aliased = _a_atobalias_balias_c_w_exists = \
_a_atobalias_balias = _b_ab1_union_c_ab2 = None
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 11bd62f64..6258e4516 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -13,6 +13,7 @@ from sqlalchemy.testing.schema import Table, Column
# sqlalhcemy.testing.suite
class QueryTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1328,6 +1329,7 @@ class TableInsertTest(fixtures.TablesTest):
"""
run_create_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -1499,6 +1501,7 @@ class TableInsertTest(fixtures.TablesTest):
class KeyTargetingTest(fixtures.TablesTest):
run_inserts = 'once'
run_deletes = None
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -1727,6 +1730,7 @@ class KeyTargetingTest(fixtures.TablesTest):
class LimitTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -1804,6 +1808,9 @@ class LimitTest(fixtures.TestBase):
class CompoundTest(fixtures.TestBase):
"""test compound statements like UNION, INTERSECT, particularly their ability to nest on
different databases."""
+
+ __backend__ = True
+
@classmethod
def setup_class(cls):
global metadata, t1, t2, t3
@@ -2101,6 +2108,7 @@ class JoinTest(fixtures.TestBase):
`JOIN rhs ON lhs.col=rhs.col` vs `rhs.col=lhs.col`. At least one
database seems to be sensitive to this.
"""
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -2365,6 +2373,8 @@ class JoinTest(fixtures.TestBase):
class OperatorTest(fixtures.TestBase):
+ __backend__ = True
+
@classmethod
def setup_class(cls):
global metadata, flds
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py
index 3cab3dc79..76a789242 100644
--- a/test/sql/test_quote.py
+++ b/test/sql/test_quote.py
@@ -6,8 +6,8 @@ from sqlalchemy import testing
from sqlalchemy.sql.elements import quoted_name, _truncated_label, _anonymous_label
from sqlalchemy.testing.util import picklers
-class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
- __dialect__ = 'default'
+class QuoteExecTest(fixtures.TestBase):
+ __backend__ = True
@classmethod
def setup_class(cls):
@@ -159,6 +159,28 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
result = select(columns, use_labels=True).execute().fetchall()
assert(result == [(1, 2, 3), (2, 2, 3), (4, 3, 2)])
+class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
+ __dialect__ = 'default'
+
+ @classmethod
+ def setup_class(cls):
+ # TODO: figure out which databases/which identifiers allow special
+ # characters to be used, such as: spaces, quote characters,
+ # punctuation characters, set up tests for those as well.
+
+ global table1, table2
+ metadata = MetaData(testing.db)
+
+ table1 = Table('WorstCase1', metadata,
+ Column('lowercase', Integer, primary_key=True),
+ Column('UPPERCASE', Integer),
+ Column('MixedCase', Integer),
+ Column('ASC', Integer, key='a123'))
+ table2 = Table('WorstCase2', metadata,
+ Column('desc', Integer, primary_key=True, key='d123'),
+ Column('Union', Integer, key='u123'),
+ Column('MixedCase', Integer))
+
@testing.crashes('oracle', 'FIXME: unknown, verify not fails_on')
@testing.requires.subqueries
def test_labels(self):
@@ -181,7 +203,6 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
where the "UPPERCASE" column of "LaLa" doesn't exist.
"""
- x = table1.select(distinct=True).alias('LaLa').select().scalar()
self.assert_compile(
table1.select(distinct=True).alias('LaLa').select(),
'SELECT '
diff --git a/test/sql/test_returning.py b/test/sql/test_returning.py
index e7245aa3c..394fe1002 100644
--- a/test/sql/test_returning.py
+++ b/test/sql/test_returning.py
@@ -10,6 +10,7 @@ import itertools
class ReturningTest(fixtures.TestBase, AssertsExecutionResults):
__requires__ = 'returning',
+ __backend__ = True
def setup(self):
meta = MetaData(testing.db)
@@ -137,6 +138,7 @@ class ReturningTest(fixtures.TestBase, AssertsExecutionResults):
class SequenceReturningTest(fixtures.TestBase):
__requires__ = 'returning', 'sequences'
+ __backend__ = True
def setup(self):
meta = MetaData(testing.db)
@@ -160,6 +162,7 @@ class KeyReturningTest(fixtures.TestBase, AssertsExecutionResults):
"""test returning() works with columns that define 'key'."""
__requires__ = 'returning',
+ __backend__ = True
def setup(self):
meta = MetaData(testing.db)
@@ -188,6 +191,7 @@ class KeyReturningTest(fixtures.TestBase, AssertsExecutionResults):
class ReturnDefaultsTest(fixtures.TablesTest):
__requires__ = ('returning', )
run_define_tables = 'each'
+ __backend__ = True
@classmethod
def define_tables(cls, metadata):
@@ -309,6 +313,8 @@ class ReturnDefaultsTest(fixtures.TablesTest):
)
class ImplicitReturningFlag(fixtures.TestBase):
+ __backend__ = True
+
def test_flag_turned_off(self):
e = engines.testing_engine(options={'implicit_returning':False})
assert e.dialect.implicit_returning is False
diff --git a/test/sql/test_rowcount.py b/test/sql/test_rowcount.py
index 2dbf4f3ea..2d3c51fa2 100644
--- a/test/sql/test_rowcount.py
+++ b/test/sql/test_rowcount.py
@@ -7,6 +7,7 @@ class FoundRowsTest(fixtures.TestBase, AssertsExecutionResults):
"""tests rowcount functionality"""
__requires__ = ('sane_rowcount', )
+ __backend__ = True
@classmethod
def setup_class(cls):
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index c7e629837..91e467aed 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -846,6 +846,7 @@ class UnicodeTest(fixtures.TestBase):
sqlalchemy/testing/suite/test_types.py.
"""
+ __backend__ = True
def test_native_unicode(self):
"""assert expected values for 'native unicode' mode"""
diff --git a/test/sql/test_unicode.py b/test/sql/test_unicode.py
index 0118b6a2b..99de16f7f 100644
--- a/test/sql/test_unicode.py
+++ b/test/sql/test_unicode.py
@@ -9,6 +9,7 @@ from sqlalchemy.util import u, ue
class UnicodeSchemaTest(fixtures.TestBase):
__requires__ = ('unicode_ddl',)
+ __backend__ = True
@classmethod
def setup_class(cls):
diff --git a/test/sql/test_update.py b/test/sql/test_update.py
index 272b5fcae..829739bcc 100644
--- a/test/sql/test_update.py
+++ b/test/sql/test_update.py
@@ -405,6 +405,7 @@ class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest,
class UpdateFromRoundTripTest(_UpdateFromTestBase, fixtures.TablesTest):
+ __backend__ = True
@testing.requires.update_from
def test_exec_two_table(self):
@@ -538,6 +539,8 @@ class UpdateFromRoundTripTest(_UpdateFromTestBase, fixtures.TablesTest):
class UpdateFromMultiTableUpdateDefaultsTest(_UpdateFromTestBase,
fixtures.TablesTest):
+ __backend__ = True
+
@classmethod
def define_tables(cls, metadata):
Table('users', metadata,