]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Removed some now unneeded version checks [ticket:2829] courtesy alex gaynor
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Sep 2013 00:35:40 +0000 (20:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Sep 2013 00:35:40 +0000 (20:35 -0400)
14 files changed:
lib/sqlalchemy/exc.py
lib/sqlalchemy/util/queue.py
test/aaa_profiling/test_zoomark.py
test/aaa_profiling/test_zoomark_orm.py
test/dialect/postgresql/test_types.py
test/engine/test_execute.py
test/engine/test_pool.py
test/ext/test_mutable.py
test/ext/test_serializer.py
test/orm/test_collection.py
test/orm/test_session.py
test/requirements.py
test/sql/test_compiler.py
test/sql/test_operators.py

index cfd1e2bc7b52f13f8249cf6ce70f30630dd58de3..7ebdc3983c78f9ef64ceaa7cafe02b6192b173ac 100644 (file)
@@ -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
index 537526beffaf56549e00d5c9bcacc88969edae81..b66738aff1c09202fa8f42a79eda6d3647e763eb 100644 (file)
@@ -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()
 
index 145f3c59478d09b42dc5449f8bc0a16c5d6db22c..d850782e0114fc2319d04b7c38f9c4a5ce6039ee 100644 (file)
@@ -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
index ddcad681ae938840101eda738b49dc9da4b560cf..c9d1438aae8e9c120bdaaac285e82b01ebf32c02 100644 (file)
@@ -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
index 784f8bcbf3b35bd1b4e98dc6bddf9091d502c24a..aed77add53919e5d43a0970045a3f647390ef848 100644 (file)
@@ -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')
index 9623c080a6491b21c4904ebcc4c2496041f202f6..b116e4d6b75627dfd7f39a1c2b45f1c029bfbe7e 100644 (file)
@@ -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
index 3f1d9d0ef82c08d5fbc89fa7607ec7fe48ab80e7..a198576d3230b23232895bef6a6f5071a097031b 100644 (file)
@@ -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 = []
index 25c182f1da45fd303d1a199fb4c21fe3d8c9cb8a..ee1b8075e94f2e4607d1887c3fb247ae742e08b5 100644 (file)
@@ -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
index 84fff1304b124b304d2c77dbe61fa1f52e132d64..64a2d5a42af72675c8164411fd28e91b47caf0ae 100644 (file)
@@ -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):
index 4eb8b3fee7a98e198ef630ceb2145966486bb96b..f6493f1a8cc7e289d4789e8c120e991908f33288 100644 (file)
@@ -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:
index a4d5b6ce62ece8406cb99c8518cb31009c6b2c9b..34b0c7effa0262771c93f4e49e6a07a065490b71 100644 (file)
@@ -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
 
index 2bd39540482af96e0924d004c92e15e8d67fdcb5..cd59e524925d0d803c2e26ee64c8e75b4ceaa762 100644 (file)
@@ -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,
index a3ec3af84e65f1bc783b66d0305a010ba3ba91e0..cd8ac2aefda6da6740d98e3deafb1bd81b595f59 100644 (file)
@@ -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(),
index ce91c5b5e35759777fc8dae874e36f6102647768..97ce3d3dd80ac04d538c74d18f5ce6ef34000450 100644 (file)
@@ -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):