diff --git a/kedro/io/kedro_data_catalog.py b/kedro/io/kedro_data_catalog.py index 9256d2a643..cba1b8a28f 100644 --- a/kedro/io/kedro_data_catalog.py +++ b/kedro/io/kedro_data_catalog.py @@ -297,7 +297,7 @@ def add_raw_data(self, data: dict[str, Any], replace: bool = False) -> None: # This method was simplified to add memory datasets only, since # adding AbstractDataset can be done via add() method for ds_name, ds_data in data.items(): - self.add(ds_name, MemoryDataset(data=ds_data), replace) + self.add(ds_name, MemoryDataset(data=ds_data), replace) # type: ignore[abstract] def add_feed_dict(self, feed_dict: dict[str, Any], replace: bool = False) -> None: # TODO: remove when removing old catalog diff --git a/tests/io/test_data_catalog.py b/tests/io/test_data_catalog.py index be8ed0831e..db777cc634 100644 --- a/tests/io/test_data_catalog.py +++ b/tests/io/test_data_catalog.py @@ -925,7 +925,7 @@ def test_multiple_catch_all_patterns_not_allowed( } with pytest.raises( - ValueError, match="Multiple catch-all patterns found in the catalog" + DatasetError, match="Multiple catch-all patterns found in the catalog" ): DataCatalog.from_config(**config_with_dataset_factories) @@ -1019,7 +1019,7 @@ def test_unmatched_key_error_when_parsing_config( "Unable to resolve 'data/01_raw/{brand}_plane.pq' from the pattern '{type}@planes'. " "Keys used in the configuration should be present in the dataset factory pattern." ) - with pytest.raises(KeyError, match=re.escape(pattern)): + with pytest.raises(DatasetError, match=re.escape(pattern)): catalog._get_dataset("jet@planes") def test_factory_config_versioned( diff --git a/tests/runner/test_sequential_runner.py b/tests/runner/test_sequential_runner.py index c8f54f7337..4f22bab296 100644 --- a/tests/runner/test_sequential_runner.py +++ b/tests/runner/test_sequential_runner.py @@ -130,7 +130,9 @@ def test_conflict_feed_catalog( def test_unsatisfied_inputs(self, is_async, unfinished_outputs_pipeline, catalog): """ds1, ds2 and ds3 were not specified.""" - with pytest.raises(ValueError, match=r"not found in the BaseDataCatalog"): + with pytest.raises( + ValueError, match=rf"not found in the {catalog.__class__.__name__}" + ): SequentialRunner(is_async=is_async).run( unfinished_outputs_pipeline, catalog )