Skip to content

Commit 7a1112e

Browse files
committed
Remove duplicate InvalidItemException
1 parent 794d59c commit 7a1112e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

aws_doc_sdk_examples_tools/entities.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
from .metadata_errors import ErrorsList
66

7-
K = TypeVar("K")
8-
9-
10-
class InvalidItemException(Exception):
11-
def __init__(self, item: K):
12-
super().__init__(self, f"Cannot append {item!r} to EntityErrors")
7+
# K = TypeVar("K")
138

149

1510
@dataclass

aws_doc_sdk_examples_tools/entities_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import pytest
22
from .entities import (
33
EntityErrors,
4-
InvalidItemException,
54
expand_all_entities,
65
MissingEntityError,
76
)
7+
from .metadata_errors import InvalidItemException
88

99

1010
def test_entity_errors_append():
@@ -14,7 +14,8 @@ def test_entity_errors_append():
1414
assert errors._errors[0].entity == "entity1"
1515

1616
with pytest.raises(InvalidItemException):
17-
errors.append("invalid item")
17+
# test runtime type checking
18+
errors.append("invalid item") # type: ignore
1819

1920

2021
def test_expand_missing_entities():

0 commit comments

Comments
 (0)