Skip to content

Commit

Permalink
Allow FormatterV2 in mock
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jul 12, 2024
1 parent 7da1557 commit 78ff3a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/lsst/pipe/base/tests/mocks/_storage_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
DatasetType,
Formatter,
FormatterFactory,
FormatterV2,
LookupKey,
SerializedDatasetType,
StorageClass,
Expand Down Expand Up @@ -606,7 +607,7 @@ def new_get_storage_class(self: StorageClassFactory, storageClassName: str) -> S

def new_get_formatter_class_with_match(
self: FormatterFactory, entity: Any
) -> tuple[LookupKey, type[Formatter], dict[str, Any]]:
) -> tuple[LookupKey, type[Formatter | FormatterV2], dict[str, Any]]:
try:
return original_get_formatter_class_with_match(self, entity)
except KeyError:
Expand All @@ -629,7 +630,7 @@ def new_get_formatter_class_with_match(

def new_get_formatter_with_match(
self: FormatterFactory, entity: Any, *args: Any, **kwargs: Any
) -> tuple[LookupKey, Formatter]:
) -> tuple[LookupKey, Formatter | FormatterV2]:
try:
return original_get_formatter_with_match(self, entity, *args, **kwargs)
except KeyError:
Expand Down

0 comments on commit 78ff3a6

Please sign in to comment.