]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
some more metadata cleanup since --dropall isnt specified on the buildbot
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Apr 2010 19:24:56 +0000 (15:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Apr 2010 19:24:56 +0000 (15:24 -0400)
test/engine/test_transaction.py
test/sql/test_rowcount.py
test/sql/test_types.py

index f6cb9a4731cd451daa3a86fdef0cdefa0ec2ea5c..a9c2a68dd8372a33e2d941c6e45ea79d25c76e6d 100644 (file)
@@ -553,14 +553,14 @@ class TLTransactionTest(TestBase):
             Column('user_name', VARCHAR(20)),
             test_needs_acid=True,
         )
-        users.create(tlengine)
+        metadata.create_all(tlengine)
 
     def teardown(self):
         tlengine.execute(users.delete()).close()
 
     @classmethod
     def teardown_class(cls):
-        users.drop(tlengine)
+        metadata.drop_all(tlengine)
         tlengine.dispose()
     
     def setup(self):
index 9577b104a67b8aa099ca44b913096e14490436e8..c12e2b272e111fa82c1890afdf82752cb796f3b2 100644 (file)
@@ -11,7 +11,7 @@ class FoundRowsTest(TestBase, AssertsExecutionResults):
     def setup_class(cls):
         metadata = MetaData(testing.db)
 
-        global employees_table
+        global employees_table, metadata
 
         employees_table = Table('employees', metadata,
             Column('employee_id', Integer, 
@@ -20,7 +20,7 @@ class FoundRowsTest(TestBase, AssertsExecutionResults):
             Column('name', String(50)),
             Column('department', String(1)),
         )
-        employees_table.create()
+        metadata.create_all()
 
     def setup(self):
         global data
@@ -41,7 +41,7 @@ class FoundRowsTest(TestBase, AssertsExecutionResults):
 
     @classmethod
     def teardown_class(cls):
-        employees_table.drop()
+        metadata.drop_all()
 
     def testbasic(self):
         s = employees_table.select()
index fb9b3912ad9b7efe04cccf879df0881e4c506d60..5bdaca6c73f1042b93d605ca4d6760b5ab446f6e 100644 (file)
@@ -585,7 +585,7 @@ class BinaryTest(TestBase, AssertsExecutionResults):
 
     @classmethod
     def setup_class(cls):
-        global binary_table, MyPickleType
+        global binary_table, MyPickleType, metadata
 
         class MyPickleType(types.TypeDecorator):
             impl = PickleType
@@ -599,8 +599,9 @@ class BinaryTest(TestBase, AssertsExecutionResults):
                 if value:
                     value.stuff = 'this is the right stuff'
                 return value
-
-        binary_table = Table('binary_table', MetaData(testing.db),
+        
+        metadata = MetaData(testing.db)
+        binary_table = Table('binary_table', metadata,
             Column('primary_id', Integer, primary_key=True, test_needs_autoincrement=True),
             Column('data', LargeBinary),
             Column('data_slice', LargeBinary(100)),
@@ -608,7 +609,7 @@ class BinaryTest(TestBase, AssertsExecutionResults):
             Column('pickled', PickleType),
             Column('mypickle', MyPickleType)
         )
-        binary_table.create()
+        metadata.create_all()
 
     @engines.close_first
     def teardown(self):
@@ -616,7 +617,7 @@ class BinaryTest(TestBase, AssertsExecutionResults):
 
     @classmethod
     def teardown_class(cls):
-        binary_table.drop()
+        metadata.drop_all()
 
     def test_round_trip(self):
         testobj1 = pickleable.Foo('im foo 1')