From 89f47326ccacdb41147c753034d3142ff692b092 Mon Sep 17 00:00:00 2001 From: gruebel Date: Sat, 14 Oct 2023 23:37:11 +0200 Subject: [PATCH] fix linting and test --- checkov/arm/base_resource_check.py | 2 +- .../cloudformation/checks/resource/base_resource_check.py | 2 +- checkov/terraform/checks/data/base_check.py | 2 +- tests/common/checks/test_base_check.py | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/checkov/arm/base_resource_check.py b/checkov/arm/base_resource_check.py index a214d103db4..0b9e2fbce50 100644 --- a/checkov/arm/base_resource_check.py +++ b/checkov/arm/base_resource_check.py @@ -2,7 +2,7 @@ from abc import abstractmethod from collections.abc import Iterable -from typing import Any, Callable +from typing import Any from checkov.arm.registry import arm_resource_registry from checkov.bicep.checks.resource.registry import registry as bicep_registry diff --git a/checkov/cloudformation/checks/resource/base_resource_check.py b/checkov/cloudformation/checks/resource/base_resource_check.py index eb72c5955a9..11dd7c005c0 100644 --- a/checkov/cloudformation/checks/resource/base_resource_check.py +++ b/checkov/cloudformation/checks/resource/base_resource_check.py @@ -1,6 +1,6 @@ from abc import abstractmethod from collections.abc import Iterable -from typing import Callable, Optional, Dict, Any +from typing import Optional, Dict, Any from checkov.cloudformation.checks.resource.registry import cfn_registry from checkov.common.checks.base_check import BaseCheck diff --git a/checkov/terraform/checks/data/base_check.py b/checkov/terraform/checks/data/base_check.py index afd87c5a5fd..66c21e0d813 100644 --- a/checkov/terraform/checks/data/base_check.py +++ b/checkov/terraform/checks/data/base_check.py @@ -2,7 +2,7 @@ from abc import abstractmethod from collections.abc import Iterable -from typing import Dict, List, Callable, Optional, Any +from typing import Dict, List, Any from checkov.common.checks.base_check import BaseCheck from checkov.common.models.enums import CheckResult, CheckCategories diff --git a/tests/common/checks/test_base_check.py b/tests/common/checks/test_base_check.py index f9ea842ebea..7685636f479 100644 --- a/tests/common/checks/test_base_check.py +++ b/tests/common/checks/test_base_check.py @@ -96,10 +96,7 @@ def __init__(self): TestCheckUnknownSignature() self.assertIsInstance(context.exception, TypeError) - self.assertEqual( - "Can't instantiate abstract class TestCheckUnknownSignature with abstract methods scan_entity_conf", - context.exception.args[0] - ) + self.assertRegex(context.exception.args[0], r"Can't instantiate abstract class TestCheckUnknownSignature with abstract method(s)? scan_entity_conf") def test_details_reinitializing_after_execution(self): check = TestCheckDetails()