raise MyCustomException("invalid!")
"""
-import sys
-if sys.version_info < (2, 5):
- class DontWrapMixin:
- pass
# Moved to orm.exc; compatibility definition installed by orm import until 0.6
UnmappedColumnError = None
from collections import deque
from time import time as _time
from .compat import threading
-import sys
-if sys.version_info < (2, 6):
- def notify_all(condition):
- condition.notify()
-else:
- def notify_all(condition):
- condition.notify_all()
__all__ = ['Empty', 'Full', 'Queue', 'SAAbort']
if not self.not_full.acquire(False):
return
try:
- notify_all(self.not_empty)
+ self.not_empty.notify_all()
finally:
self.not_full.release()
"""
__requires__ = 'cpython',
__only_on__ = 'postgresql+psycopg2'
- __skip_if__ = lambda : sys.version_info < (2, 5),
def test_baseline_0_setup(self):
global metadata
__requires__ = 'cpython',
__only_on__ = 'postgresql+psycopg2'
- __skip_if__ = lambda : sys.version_info < (2, 5),
def test_baseline_0_setup(self):
global metadata, session
__only_on__ = 'postgresql'
- @testing.requires.python25
@testing.fails_on('postgresql+zxjdbc',
'column "data" is of type uuid but expression is of type character varying')
@testing.fails_on('postgresql+pg8000', 'No support for UUID type')
str(uuid.uuid4())
)
- @testing.requires.python25
@testing.fails_on('postgresql+zxjdbc',
'column "data" is of type uuid but expression is of type character varying')
@testing.fails_on('postgresql+pg8000', 'No support for UUID type')
eq_(len(mock_rowcount.__get__.mock_calls), 2)
- @testing.requires.python26
def test_rowproxy_is_sequence(self):
import collections
from sqlalchemy.engine import RowProxy
eq_(len(success), 12, "successes: %s" % success)
@testing.requires.threading_with_mock
- @testing.requires.python26
def test_notify_waiters(self):
dbapi = MockDBAPI()
canary = []
self._test_non_mutable()
class MutableWithScalarJSONTest(_MutableDictTestBase, fixtures.MappedTest):
- # json introduced in 2.6
- __skip_if__ = lambda: sys.version_info < (2, 6),
-
@classmethod
def define_tables(cls, metadata):
import json
)
class MutableAssociationScalarJSONTest(_MutableDictTestBase, fixtures.MappedTest):
- # json introduced in 2.6
- __skip_if__ = lambda: sys.version_info < (2, 6),
-
@classmethod
def define_tables(cls, metadata):
import json
assert serializer.loads(serializer.dumps(User.name, -1), None,
None) is User.name
- @testing.requires.python26 # crashes in 2.5
def test_expression(self):
expr = \
select([users]).select_from(users.join(addresses)).limit(5)
assert j2.right is j.right
assert j2._target_adapter._next
- @testing.requires.python26 # namedtuple workaround not serializable in 2.5
@testing.exclude('sqlite', '<=', (3, 5, 9),
'id comparison failing on the buildbot')
def test_aliases(self):
control.update(d)
assert_eq()
- if sys.version_info >= (2, 4):
- kw = dict([(ee.a, ee) for ee in [e, creator()]])
- direct.update(**kw)
- control.update(**kw)
- assert_eq()
+ kw = dict([(ee.a, ee) for ee in [e, creator()]])
+ direct.update(**kw)
+ control.update(**kw)
+ assert_eq()
def _test_dict_bulk(self, typecallable, creator=None):
if creator is None:
eq_(bind.connect().execute("select count(1) from users").scalar(), 1)
sess.close()
- @testing.requires.python26
def test_with_no_autoflush(self):
User, users = self.classes.User, self.tables.users
"Python version 3.xx is required."
)
- @property
- def python26(self):
- return skip_if(
- lambda: sys.version_info < (2, 6),
- "Python version 2.6 or greater is required"
- )
-
- @property
- def python25(self):
- return skip_if(
- lambda: sys.version_info < (2, 5),
- "Python version 2.5 or greater is required"
- )
-
@property
def cpython(self):
return only_if(lambda: util.cpython,
schema.CreateTable(t1).compile
)
- # there's some unicode issue in the assertion
- # regular expression that appears to be resolved
- # in 2.6, not exactly sure what it is
- @testing.requires.python26
def test_reraise_of_column_spec_issue_unicode(self):
MyType = self._illegal_type_fixture()
t1 = Table('t', MetaData(),
"x -> :x_1"
)
- @testing.requires.python26
def test_op_not_an_iterator(self):
# see [ticket:2726]
class MyType(UserDefinedType):