@contextlib.contextmanager
def expect_warnings_on(db, *messages, **kw):
 spec = db_spec(db)
 if (isinstance(db, util.string_types) and (not spec(config._current))):
  (yield)
 else:
  with expect_warnings(*messages, **kw):
   (yield)

@ contextlib . contextmanager def expect_warnings_on ( db , * messages , ** kw ) : spec = db_spec ( db ) if ( isinstance ( db , util . string_types ) and ( not spec ( config . _current ) ) ) : ( yield ) else : with expect_warnings ( * messages , ** kw ) : ( yield )
context manager which expects one or more warnings on specific dialects .