From: Mike Bayer Date: Mon, 23 Sep 2013 00:35:40 +0000 (-0400) Subject: - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynor X-Git-Tag: rel_0_9_0b1~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08a6a8b51916ab1d084a0070bbb07001cabb1c38;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynor --- diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index cfd1e2bc7b..7ebdc3983c 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -187,10 +187,6 @@ class DontWrapMixin(object): 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 diff --git a/lib/sqlalchemy/util/queue.py b/lib/sqlalchemy/util/queue.py index 537526beff..b66738aff1 100644 --- a/lib/sqlalchemy/util/queue.py +++ b/lib/sqlalchemy/util/queue.py @@ -25,14 +25,7 @@ within QueuePool. 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'] @@ -195,7 +188,7 @@ class Queue: if not self.not_full.acquire(False): return try: - notify_all(self.not_empty) + self.not_empty.notify_all() finally: self.not_full.release() diff --git a/test/aaa_profiling/test_zoomark.py b/test/aaa_profiling/test_zoomark.py index 145f3c5947..d850782e01 100644 --- a/test/aaa_profiling/test_zoomark.py +++ b/test/aaa_profiling/test_zoomark.py @@ -30,7 +30,6 @@ class ZooMarkTest(fixtures.TestBase): """ __requires__ = 'cpython', __only_on__ = 'postgresql+psycopg2' - __skip_if__ = lambda : sys.version_info < (2, 5), def test_baseline_0_setup(self): global metadata diff --git a/test/aaa_profiling/test_zoomark_orm.py b/test/aaa_profiling/test_zoomark_orm.py index ddcad681ae..c9d1438aae 100644 --- a/test/aaa_profiling/test_zoomark_orm.py +++ b/test/aaa_profiling/test_zoomark_orm.py @@ -32,7 +32,6 @@ class ZooMarkTest(fixtures.TestBase): __requires__ = 'cpython', __only_on__ = 'postgresql+psycopg2' - __skip_if__ = lambda : sys.version_info < (2, 5), def test_baseline_0_setup(self): global metadata, session diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index 784f8bcbf3..aed77add53 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -918,7 +918,6 @@ class UUIDTest(fixtures.TestBase): __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') @@ -932,7 +931,6 @@ class UUIDTest(fixtures.TestBase): 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') diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index 9623c080a6..b116e4d6b7 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -930,7 +930,6 @@ class ResultProxyTest(fixtures.TestBase): eq_(len(mock_rowcount.__get__.mock_calls), 2) - @testing.requires.python26 def test_rowproxy_is_sequence(self): import collections from sqlalchemy.engine import RowProxy diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index 3f1d9d0ef8..a198576d32 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -911,7 +911,6 @@ class QueuePoolTest(PoolTestBase): eq_(len(success), 12, "successes: %s" % success) @testing.requires.threading_with_mock - @testing.requires.python26 def test_notify_waiters(self): dbapi = MockDBAPI() canary = [] diff --git a/test/ext/test_mutable.py b/test/ext/test_mutable.py index 25c182f1da..ee1b8075e9 100644 --- a/test/ext/test_mutable.py +++ b/test/ext/test_mutable.py @@ -153,9 +153,6 @@ class MutableWithScalarPickleTest(_MutableDictTestBase, fixtures.MappedTest): 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 @@ -245,9 +242,6 @@ class MutableAssociationScalarPickleTest(_MutableDictTestBase, fixtures.MappedTe ) 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 diff --git a/test/ext/test_serializer.py b/test/ext/test_serializer.py index 84fff1304b..64a2d5a42a 100644 --- a/test/ext/test_serializer.py +++ b/test/ext/test_serializer.py @@ -77,7 +77,6 @@ class SerializeTest(fixtures.MappedTest): 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) @@ -149,7 +148,6 @@ class SerializeTest(fixtures.MappedTest): 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): diff --git a/test/orm/test_collection.py b/test/orm/test_collection.py index 4eb8b3fee7..f6493f1a8c 100644 --- a/test/orm/test_collection.py +++ b/test/orm/test_collection.py @@ -981,11 +981,10 @@ class CollectionsTest(fixtures.ORMTest): 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: diff --git a/test/orm/test_session.py b/test/orm/test_session.py index a4d5b6ce62..34b0c7effa 100644 --- a/test/orm/test_session.py +++ b/test/orm/test_session.py @@ -435,7 +435,6 @@ class SessionStateTest(_fixtures.FixtureTest): 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 diff --git a/test/requirements.py b/test/requirements.py index 2bd3954048..cd59e52492 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -554,20 +554,6 @@ class DefaultRequirements(SuiteRequirements): "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, diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index a3ec3af84e..cd8ac2aefd 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -2785,10 +2785,6 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL): 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(), diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index ce91c5b5e3..97ce3d3dd8 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -352,7 +352,6 @@ class ExtensionOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL): "x -> :x_1" ) - @testing.requires.python26 def test_op_not_an_iterator(self): # see [ticket:2726] class MyType(UserDefinedType):