Commits

Mike Bayer  committed 81dfc72

- [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]

  • Participants
  • Parent commits 9dd5d5a
  • Branches rel_0_7

Comments (0)

Files changed (4)

     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

File lib/sqlalchemy/__init__.py

     )
 
 from sqlalchemy.types import (
+    BIGINT,
+    BINARY,
     BLOB,
     BOOLEAN,
     BigInteger,
     TypeDecorator,
     Unicode,
     UnicodeText,
+    VARBINARY,
     VARCHAR,
     )
 

File lib/sqlalchemy/types.py

 __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

File test/sql/test_types.py

         return [d.base.dialect() for d in 
                 self._all_dialect_modules()]
 
+    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
+
     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
+        for typ in self._types_for_mod(types):
+            yield typ
+        for dialect in self._all_dialect_modules():
+            for typ in self._types_for_mod(dialect):
                 yield typ
 
-        for typ in types_for_mod(types):
-            yield typ
-        for dialect in self._all_dialect_modules():
-            for typ in 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