parameters,
cursor,
context):
-
exc_info = sys.exc_info()
if context and context.exception is None:
"""
return exclusions.open()
+ @property
+ def graceful_disconnects(self):
+ """Target driver must raise a DBAPI-level exception, such as
+ InterfaceError, when the underlying connection has been closed
+ and the execute() method is called.
+ """
+ return exclusions.open()
+
@property
def skip_mysql_on_windows(self):
"""Catchall for a large variety of MySQL on Windows failures"""
r = eval(py)
assert list(r) == [(1,)], py
- @testing.fails_on('postgresql+pg8000', 'pg8000 requires explicit types')
def test_platform_escape(self):
"""test the escaping of % characters in the DDL construct."""
default_from = testing.db.dialect.statement_compiler(
- testing.db.dialect, None).default_from()
+ testing.db.dialect, None).default_from()
# We're abusing the DDL()
# construct here by pushing a SELECT through it
@testing.fails_on('+pyodbc',
"pyodbc cursor doesn't implement tuple __eq__")
+ @testing.fails_on("+pg8000", "returns [1], not (1,)")
def test_cursor_iterable(self):
conn = testing.db.raw_connection()
cursor = conn.cursor()
for row in cursor:
eq_(row, expected.pop(0))
-
def test_no_connect_on_recreate(self):
def creator():
raise Exception("no creates allowed")
)
-
def _assert_invalidated(fn, *args):
try:
fn(*args)
if not e.connection_invalidated:
raise
+
class RealReconnectTest(fixtures.TestBase):
__backend__ = True
+ __requires__ = 'graceful_disconnects',
def setup(self):
self.engine = engines.reconnecting_engine()
from sqlalchemy.ext import serializer
from sqlalchemy import testing
from sqlalchemy import Integer, String, ForeignKey, select, \
- desc, func, util, MetaData
+ desc, func, util, MetaData, literal_column
from sqlalchemy.testing.schema import Table
from sqlalchemy.testing.schema import Column
from sqlalchemy.orm import relationship, sessionmaker, scoped_session, \
self.assert_sql_count(testing.db, go, 1)
eq_(q2.join(User.addresses).filter(Address.email
- == 'ed@bettyboop.com').value(func.count('*')), 1)
+ == 'ed@bettyboop.com').value(func.count(literal_column('*'))), 1)
u1 = Session.query(User).get(8)
q = Session.query(Address).filter(Address.user
== u1).order_by(desc(Address.email))
no_support("postgresql+pg8000", "not supported and/or hangs")
])
+ @property
+ def graceful_disconnects(self):
+ """Target driver must raise a DBAPI-level exception, such as
+ InterfaceError, when the underlying connection has been closed
+ and the execute() method is called.
+ """
+ return fails_on(
+ "postgresql+pg8000", "Driver crashes"
+ )
+
@property
def views(self):
"""Target database must support VIEWs."""