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):
def setup_class(cls):
metadata = MetaData(testing.db)
- global employees_table
+ global employees_table, metadata
employees_table = Table('employees', metadata,
Column('employee_id', Integer,
Column('name', String(50)),
Column('department', String(1)),
)
- employees_table.create()
+ metadata.create_all()
def setup(self):
global data
@classmethod
def teardown_class(cls):
- employees_table.drop()
+ metadata.drop_all()
def testbasic(self):
s = employees_table.select()
@classmethod
def setup_class(cls):
- global binary_table, MyPickleType
+ global binary_table, MyPickleType, metadata
class MyPickleType(types.TypeDecorator):
impl = PickleType
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)),
Column('pickled', PickleType),
Column('mypickle', MyPickleType)
)
- binary_table.create()
+ metadata.create_all()
@engines.close_first
def teardown(self):
@classmethod
def teardown_class(cls):
- binary_table.drop()
+ metadata.drop_all()
def test_round_trip(self):
testobj1 = pickleable.Foo('im foo 1')