From c194962019d1bc7322e20b82c33aa1bab3bc2a28 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Sat, 12 Jan 2008 04:52:05 +0000 Subject: - Undeclared SAWarnings are now fatal to tests as well. - Fixed typo that was killing runs of individual named tests. --- test/engine/reflection.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'test/engine/reflection.py') diff --git a/test/engine/reflection.py b/test/engine/reflection.py index ea56e315b..c123b930a 100644 --- a/test/engine/reflection.py +++ b/test/engine/reflection.py @@ -1,6 +1,5 @@ import testbase -import pickle, StringIO, unicodedata, warnings - +import pickle, StringIO, unicodedata from sqlalchemy import * from sqlalchemy import exceptions from sqlalchemy import types as sqltypes @@ -206,21 +205,20 @@ class ReflectionTest(PersistTest): dialect_module.ischema_names = {} try: try: - warnings.filterwarnings('error', 'Did not recognize type') m2 = MetaData(testbase.db) t2 = Table("test", m2, autoload=True) assert False - except RuntimeWarning: + except exceptions.SAWarning: assert True - warnings.filterwarnings('ignore', 'Did not recognize type') - m3 = MetaData(testbase.db) - t3 = Table("test", m3, autoload=True) - assert t3.c.foo.type.__class__ == sqltypes.NullType + @testing.emits_warning('Did not recognize type') + def warns(): + m3 = MetaData(testbase.db) + t3 = Table("test", m3, autoload=True) + assert t3.c.foo.type.__class__ == sqltypes.NullType finally: dialect_module.ischema_names = ischema_names - warnings.filterwarnings('always', 'Did not recognize type') t.drop() def test_override_fkandpkcol(self): -- cgit v1.2.1