Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Khaustova <ymax70rus@gmail.com>
  • Loading branch information
ElenaKhaustova committed Sep 13, 2024
1 parent cf663a0 commit caa7316
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kedro/io/kedro_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/io/test_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion tests/runner/test_sequential_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit caa7316

Please sign in to comment.