mirror of
https://github.com/ansible/ansible.git
synced 2026-07-29 16:35:20 +02:00
Clean up TE error handling, wrap sigalrm handler (#85232)
* Clean up TE error handling, wrap sigalrm handler * Preserve error detail on AnsibleAction and Connection exceptions. * Remove multiple layers of unreachable or redundant error handling. * Wrap manual alarm signal/timeout handling into a context manager, add tests. Co-authored-by: Matt Clay <matt@mystile.com> * update error message check in test * update test timeout message assertions --------- Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible import errors
|
||||
|
||||
from units.test_utils.controller.display import emits_warnings
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", (
|
||||
"AnsibleFilterTypeError",
|
||||
"_AnsibleActionDone",
|
||||
))
|
||||
def test_deprecated(name: str) -> None:
|
||||
with emits_warnings(deprecation_pattern='is deprecated'):
|
||||
getattr(errors, name)
|
||||
|
||||
|
||||
def test_deprecated_attribute_error() -> None:
|
||||
with pytest.raises(AttributeError):
|
||||
getattr(errors, 'bogus')
|
||||
Reference in New Issue
Block a user