]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- [bug] added BIGINT to types.__all__,
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 13 Jun 2012 21:59:07 +0000 (17:59 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 13 Jun 2012 21:59:07 +0000 (17:59 -0400)
BIGINT, BINARY, VARBINARY to sqlalchemy
module namespace, plus test to ensure
this breakage doesn't occur again.
[ticket:2499]

CHANGES
lib/sqlalchemy/__init__.py
lib/sqlalchemy/types.py
test/sql/test_types.py

diff --git a/CHANGES b/CHANGES
index 0c17b2d30c5bf7a451f0a3c6cfb13506dbd7e8bd..0fb6a9f856bf50c2b70f9d63a3f28de478249314 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -32,6 +32,13 @@ CHANGES
     was not accepting a scalar argument 
     for the identity.  [ticket:2508].
 
+- sql
+  - [bug] added BIGINT to types.__all__,
+    BIGINT, BINARY, VARBINARY to sqlalchemy
+    module namespace, plus test to ensure
+    this breakage doesn't occur again.
+    [ticket:2499]
+
 - engine
   - [bug] Fixed memory leak in C version of
     result proxy whereby DBAPIs which don't deliver
index ab3a28db21c2a7a2e1c64f15da553b173e6ba5e2..6212bd311cca838931deec9c2e51abd5670e6944 100644 (file)
@@ -50,6 +50,8 @@ from sqlalchemy.sql import (
     )
 
 from sqlalchemy.types import (
+    BIGINT,
+    BINARY,
     BLOB,
     BOOLEAN,
     BigInteger,
@@ -87,6 +89,7 @@ from sqlalchemy.types import (
     TypeDecorator,
     Unicode,
     UnicodeText,
+    VARBINARY,
     VARCHAR,
     )
 
index e5dbe8671b092939990da445ef642442c37f7ad4..0699e498a23684f638aa8cc498b664ecb8686863 100644 (file)
@@ -14,11 +14,11 @@ For more information see the SQLAlchemy documentation on types.
 __all__ = [ 'TypeEngine', 'TypeDecorator', 'AbstractType', 'UserDefinedType',
             'INT', 'CHAR', 'VARCHAR', 'NCHAR', 'NVARCHAR','TEXT', 'Text',
             'FLOAT', 'NUMERIC', 'REAL', 'DECIMAL', 'TIMESTAMP', 'DATETIME', 
-            'CLOB', 'BLOB', 'BINARY', 'VARBINARY', 'BOOLEAN', 'SMALLINT', 'INTEGER', 'DATE', 'TIME',
-            'String', 'Integer', 'SmallInteger', 'BigInteger', 'Numeric',
-            'Float', 'DateTime', 'Date', 'Time', 'LargeBinary', 'Binary',
-            'Boolean', 'Unicode', 'MutableType', 'Concatenable',
-            'UnicodeText','PickleType', 'Interval', 'Enum' ]
+            'CLOB', 'BLOB', 'BINARY', 'VARBINARY', 'BOOLEAN', 'BIGINT', 'SMALLINT',
+            'INTEGER', 'DATE', 'TIME', 'String', 'Integer', 'SmallInteger',
+            'BigInteger', 'Numeric', 'Float', 'DateTime', 'Date', 'Time',
+            'LargeBinary', 'Binary', 'Boolean', 'Unicode', 'Concatenable',
+            'UnicodeText','PickleType', 'Interval', 'Enum', 'MutableType' ]
 
 import inspect
 import datetime as dt
index 951e1551d8f31aec44a3bbcf8f7253b3fd6681b9..659c7f2ae3f6578e6a2fd44429407ad777ccc5b3 100644 (file)
@@ -29,20 +29,27 @@ class AdaptTest(fixtures.TestBase):
         return [d.base.dialect() for d in 
                 self._all_dialect_modules()]
 
-    def _all_types(self):
-        def types_for_mod(mod):
-            for key in dir(mod):
-                typ = getattr(mod, key)
-                if not isinstance(typ, type) or not issubclass(typ, types.TypeEngine):
-                    continue
-                yield typ
+    def _types_for_mod(self, mod):
+        for key in dir(mod):
+            typ = getattr(mod, key)
+            if not isinstance(typ, type) or not issubclass(typ, types.TypeEngine):
+                continue
+            yield typ
 
-        for typ in types_for_mod(types):
+    def _all_types(self):
+        for typ in self._types_for_mod(types):
             yield typ
         for dialect in self._all_dialect_modules():
-            for typ in types_for_mod(dialect):
+            for typ in self._types_for_mod(dialect):
                 yield typ
 
+    def test_uppercase_importable(self):
+        import sqlalchemy as sa
+        for typ in self._types_for_mod(types):
+            if typ.__name__ == typ.__name__.upper():
+                assert getattr(sa, typ.__name__) is typ
+                assert typ.__name__ in types.__all__
+
     def test_uppercase_rendering(self):
         """Test that uppercase types from types.py always render as their
         type.