fix test_handle_exceptions

This commit is contained in:
Sina Atalay 2024-02-24 20:48:34 +01:00
parent dfcb542f3e
commit 957628196b
1 changed files with 5 additions and 5 deletions

View File

@ -142,17 +142,17 @@ def test_handle_validation_error(data_model_class, invalid_model):
@pytest.mark.parametrize(
"exception",
[
ruamel.yaml.YAMLError,
RuntimeError,
FileNotFoundError,
ValueError,
ruamel.yaml.YAMLError("message"),
RuntimeError("message"),
FileNotFoundError("message"),
ValueError("message"),
UnicodeDecodeError("utf-8", b"", 1, 2, "message"),
],
)
def test_handle_exceptions(exception):
@cli.handle_exceptions
def function_that_raises_exception():
raise exception("This is an exception!")
raise exception
function_that_raises_exception()