mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-19 23:21:57 -04:00
5b779d30c3
test-run- and dialect-specific options on those objects All tests re-pointed to go through the interceptors - Removed mysql_engine= from table declarations, replaced with a general flag indicating storage requirements - Added ability to choose a global MySQL storage engine for all tests --mysql-engine=<whatever> If none is specified, tests use the old db-default/InnoDB behavior - Added ability to append arbitrary table creation params --table-option=KEY=VALUE For MySQL 3, use this to set mysql_type instead of --mysql-engine - Removed a couple dead test modules
19 lines
534 B
Python
19 lines
534 B
Python
import testbase
|
|
from sqlalchemy import *
|
|
from testbase import Table, Column
|
|
|
|
class MetaDataTest(testbase.PersistTest):
|
|
def test_metadata_connect(self):
|
|
metadata = MetaData()
|
|
t1 = Table('table1', metadata, Column('col1', Integer, primary_key=True),
|
|
Column('col2', String(20)))
|
|
metadata.engine = testbase.db
|
|
metadata.create_all()
|
|
try:
|
|
assert t1.count().scalar() == 0
|
|
finally:
|
|
metadata.drop_all()
|
|
|
|
if __name__ == '__main__':
|
|
testbase.main()
|