Skip to content

Commit

Permalink
Remove duplicate InvalidItemException
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Oct 8, 2024
1 parent 794d59c commit 7a1112e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions aws_doc_sdk_examples_tools/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

from .metadata_errors import ErrorsList

K = TypeVar("K")


class InvalidItemException(Exception):
def __init__(self, item: K):
super().__init__(self, f"Cannot append {item!r} to EntityErrors")
# K = TypeVar("K")


@dataclass
Expand Down
5 changes: 3 additions & 2 deletions aws_doc_sdk_examples_tools/entities_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
from .entities import (
EntityErrors,
InvalidItemException,
expand_all_entities,
MissingEntityError,
)
from .metadata_errors import InvalidItemException


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

with pytest.raises(InvalidItemException):
errors.append("invalid item")
# test runtime type checking
errors.append("invalid item") # type: ignore


def test_expand_missing_entities():
Expand Down

0 comments on commit 7a1112e

Please sign in to comment.