legacy adapter function for functions that were previously using assert_raises with SAWarning or similar. has some workarounds to accommodate the fact that the callable completes with this approach rather than stopping at the exception raise.
(except_cls, callable_, *args, **kwargs)
| 405 | |
| 406 | |
| 407 | def assert_warns(except_cls, callable_, *args, **kwargs): |
| 408 | """legacy adapter function for functions that were previously using |
| 409 | assert_raises with SAWarning or similar. |
| 410 | |
| 411 | has some workarounds to accommodate the fact that the callable completes |
| 412 | with this approach rather than stopping at the exception raise. |
| 413 | |
| 414 | |
| 415 | """ |
| 416 | with _expect_warnings_sqla_only(except_cls, [".*"]): |
| 417 | return callable_(*args, **kwargs) |
| 418 | |
| 419 | |
| 420 | def assert_warns_message(except_cls, msg, callable_, *args, **kwargs): |