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)
| 399 | |
| 400 | |
| 401 | def assert_warns(except_cls, callable_, *args, **kwargs): |
| 402 | """legacy adapter function for functions that were previously using |
| 403 | assert_raises with SAWarning or similar. |
| 404 | |
| 405 | has some workarounds to accommodate the fact that the callable completes |
| 406 | with this approach rather than stopping at the exception raise. |
| 407 | |
| 408 | |
| 409 | """ |
| 410 | with _expect_warnings_sqla_only(except_cls, [".*"]): |
| 411 | return callable_(*args, **kwargs) |
| 412 | |
| 413 | |
| 414 | def assert_warns_message(except_cls, msg, callable_, *args, **kwargs): |