From 78ff3a6cd28c92c6c136ca6cedbefb247e18f695 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 27 Jun 2024 15:07:14 -0700 Subject: [PATCH] Allow FormatterV2 in mock --- python/lsst/pipe/base/tests/mocks/_storage_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/lsst/pipe/base/tests/mocks/_storage_class.py b/python/lsst/pipe/base/tests/mocks/_storage_class.py index e1381b89..0173e180 100644 --- a/python/lsst/pipe/base/tests/mocks/_storage_class.py +++ b/python/lsst/pipe/base/tests/mocks/_storage_class.py @@ -51,6 +51,7 @@ DatasetType, Formatter, FormatterFactory, + FormatterV2, LookupKey, SerializedDatasetType, StorageClass, @@ -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: @@ -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: