]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
identified the SQLite changes which affect default reflection
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 3 Jan 2009 18:06:59 +0000 (18:06 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 3 Jan 2009 18:06:59 +0000 (18:06 +0000)
lib/sqlalchemy/databases/sqlite.py
test/dialect/sqlite.py

index 83dfc60f0af30e402babcee0698b3f207e2acee6..1d89d1147caf92b869c492bc7cf18052fe891951 100644 (file)
@@ -490,10 +490,7 @@ class SQLiteDialect(default.DefaultDialect):
 
             colargs = []
             if has_default:
-                try:
-                    colargs.append(DefaultClause(sql.text(default)))
-                except:
-                    colargs.append(DefaultClause(sql.text("what the heck is this: %r" % default)))
+                colargs.append(DefaultClause(sql.text(default)))
             table.append_column(schema.Column(name, coltype, primary_key = primary_key, nullable = nullable, *colargs))
 
         if not found_table:
index 9cedb5a2f480513e1ef746bb2cc100c5fb2e23c2..97d12bf60357e1fb7ec5bdd08e09577ae1c0931e 100644 (file)
@@ -109,7 +109,6 @@ class TestTypes(TestBase, AssertsExecutionResults):
                 expected = [len(c) > 1 and c[1] or c[0] for c in specs]
                 for table in rt, rv:
                     for i, reflected in enumerate(table.c):
-                        print reflected.type, type(expected[i])
                         assert isinstance(reflected.type, type(expected[i])), type(expected[i])
             finally:
                 db.execute('DROP VIEW types_v')
@@ -120,6 +119,8 @@ class TestTypes(TestBase, AssertsExecutionResults):
 class TestDefaults(TestBase, AssertsExecutionResults):
     __only_on__ = 'sqlite'
 
+    @testing.exclude('sqlite', '<', (3, 3, 8), 
+        "sqlite3 changesets 3353 and 3440 modified behavior of default displayed in pragma table_info()")
     def test_default_reflection(self):
         # (ask_for, roundtripped_as_if_different)
         specs = [( String(3), '"foo"' ),
@@ -144,6 +145,8 @@ class TestDefaults(TestBase, AssertsExecutionResults):
         finally:
             m.drop_all()
 
+    @testing.exclude('sqlite', '<', (3, 3, 8), 
+        "sqlite3 changesets 3353 and 3440 modified behavior of default displayed in pragma table_info()")
     def test_default_reflection_2(self):
         db = testing.db
         m = MetaData(db)
@@ -295,7 +298,6 @@ class InsertTest(TestBase, AssertsExecutionResults):
                 table.insert().execute()
 
                 rows = table.select().execute().fetchall()
-                print rows
                 self.assertEquals(len(rows), wanted)
         finally:
             table.drop()