Context manager which expects one or more warnings on specific dialects. The expect version **asserts** that the warnings were in fact seen.
(db, *messages, **kw)
| 52 | |
| 53 | @contextlib.contextmanager |
| 54 | def expect_warnings_on(db, *messages, **kw): |
| 55 | """Context manager which expects one or more warnings on specific |
| 56 | dialects. |
| 57 | |
| 58 | The expect version **asserts** that the warnings were in fact seen. |
| 59 | |
| 60 | """ |
| 61 | spec = db_spec(db) |
| 62 | |
| 63 | if isinstance(db, str) and not spec(config._current): |
| 64 | yield |
| 65 | else: |
| 66 | with expect_warnings(*messages, **kw): |
| 67 | yield |
| 68 | |
| 69 | |
| 70 | def emits_warning(*messages): |
no test coverage detected