From a5816bf013d6630bb5aa2d8188f66b777f29b63b Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Sat, 26 Nov 2022 14:02:49 +0100 Subject: [PATCH] chore: linters --- aea/cli/utils/click_utils.py | 4 ++-- scripts/whitelist.py | 1 + tests/test_cli/test_add/test_click_utils.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/aea/cli/utils/click_utils.py b/aea/cli/utils/click_utils.py index 6ef8045a8e..ade8385022 100644 --- a/aea/cli/utils/click_utils.py +++ b/aea/cli/utils/click_utils.py @@ -23,7 +23,7 @@ from collections import OrderedDict from contextlib import contextmanager from pathlib import Path -from typing import Any, Callable, List, Optional, Sequence, Type, Union, cast +from typing import Any, Callable, Generator, List, Optional, Sequence, Type, Union, cast import click from click import argument, option @@ -385,7 +385,7 @@ def determine_package_type_for_directory(package_dir: Path) -> PackageType: @contextmanager -def reraise_as_click_exception(*exceptions: Type[Exception]): +def reraise_as_click_exception(*exceptions: Type[Exception]) -> Generator: """Reraise exceptions as ClickException""" try: yield diff --git a/scripts/whitelist.py b/scripts/whitelist.py index 0abf7f95be..eab11646d3 100644 --- a/scripts/whitelist.py +++ b/scripts/whitelist.py @@ -330,3 +330,4 @@ ACNWithBootstrappedEntryNodesDockerImage # unused class (aea/test_tools/acn_image.py:166) default_method_call # unused method (aea/contracts/base.py:260) send_control_c # unused method (aea/helpers/base.py:188) +reraise_as_click_exception # unused function (aea/cli/utils/click_utils.py:387) diff --git a/tests/test_cli/test_add/test_click_utils.py b/tests/test_cli/test_add/test_click_utils.py index 7812a3d0b5..90b2aeae27 100644 --- a/tests/test_cli/test_add/test_click_utils.py +++ b/tests/test_cli/test_add/test_click_utils.py @@ -44,7 +44,7 @@ def test_reraise_as_click_exception() -> None: with pytest.raises(ValueError): with pytest.raises(ZeroDivisionError): raise ValueError() - assert False + raise AssertionError() # 1. do not raise on pass with reraise_as_click_exception():