From: Mike Bayer Date: Fri, 16 Apr 2010 19:24:56 +0000 (-0400) Subject: some more metadata cleanup since --dropall isnt specified on the buildbot X-Git-Tag: rel_0_6_0~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b437bb213221e98fd5909a9082df8b4b6a25fc3f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git some more metadata cleanup since --dropall isnt specified on the buildbot --- diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py index f6cb9a4731..a9c2a68dd8 100644 --- a/test/engine/test_transaction.py +++ b/test/engine/test_transaction.py @@ -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): diff --git a/test/sql/test_rowcount.py b/test/sql/test_rowcount.py index 9577b104a6..c12e2b272e 100644 --- a/test/sql/test_rowcount.py +++ b/test/sql/test_rowcount.py @@ -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() diff --git a/test/sql/test_types.py b/test/sql/test_types.py index fb9b3912ad..5bdaca6c73 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -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')