diff options
Diffstat (limited to 'test/engine/metadata.py')
| -rw-r--r-- | test/engine/metadata.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/engine/metadata.py b/test/engine/metadata.py index 22cdaafee..90f8a00a8 100644 --- a/test/engine/metadata.py +++ b/test/engine/metadata.py @@ -1,8 +1,11 @@ import testenv; testenv.configure_for_tests() -from sqlalchemy import * -from sqlalchemy import exceptions -from testlib import * import pickle +from sqlalchemy import MetaData +from testlib.sa import Table, Column, Integer, String, UniqueConstraint, \ + CheckConstraint, ForeignKey +import testlib.sa as tsa +from testlib import TestBase, ComparesTables, testing + class MetaDataTest(TestBase, ComparesTables): def test_metadata_connect(self): @@ -30,7 +33,7 @@ class MetaDataTest(TestBase, ComparesTables): t2 = Table('table1', metadata, Column('col1', Integer, primary_key=True), Column('col2', String(20))) assert False - except exceptions.InvalidRequestError, e: + except tsa.exc.InvalidRequestError, e: assert str(e) == "Table 'table1' is already defined for this MetaData instance. Specify 'useexisting=True' to redefine options and columns on an existing Table object." finally: metadata.drop_all() @@ -109,7 +112,7 @@ class MetaDataTest(TestBase, ComparesTables): meta.drop_all(testing.db) def test_nonexistent(self): - self.assertRaises(exceptions.NoSuchTableError, Table, + self.assertRaises(tsa.exc.NoSuchTableError, Table, 'fake_table', MetaData(testing.db), autoload=True) |
