summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-04-16 15:24:56 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-04-16 15:24:56 -0400
commitb437bb213221e98fd5909a9082df8b4b6a25fc3f (patch)
tree5164d0de867d1c8fcbe2617eef9a5cf99bc4f518 /test/sql
parentab62d418b2b3dda9693e371e084b33ac8d23a6a6 (diff)
downloadsqlalchemy-b437bb213221e98fd5909a9082df8b4b6a25fc3f.tar.gz
some more metadata cleanup since --dropall isnt specified on the buildbot
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_rowcount.py6
-rw-r--r--test/sql/test_types.py11
2 files changed, 9 insertions, 8 deletions
diff --git a/test/sql/test_rowcount.py b/test/sql/test_rowcount.py
index 9577b104a..c12e2b272 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 fb9b3912a..5bdaca6c7 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')