Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest): use temp dir for file generated during test #5505

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions metadata-ingestion/tests/unit/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_configure_with_rest_sink_initializes_graph(

@freeze_time(FROZEN_TIME)
@patch("datahub.ingestion.source.kafka.KafkaSource.get_workunits", autospec=True)
def test_configure_with_file_sink_does_not_init_graph(self, mock_source):
def test_configure_with_file_sink_does_not_init_graph(self, mock_source, tmp_path):
pipeline = Pipeline.create(
{
"source": {
Expand All @@ -119,15 +119,15 @@ def test_configure_with_file_sink_does_not_init_graph(self, mock_source):
"sink": {
"type": "file",
"config": {
"filename": "test.json",
"filename": str(tmp_path / "test.json"),
},
},
}
)
# assert that the default sink config is for a DatahubRestSink
assert isinstance(pipeline.config.sink, DynamicTypedConfig)
assert pipeline.config.sink.type == "file"
assert pipeline.config.sink.config == {"filename": "test.json"}
assert pipeline.config.sink.config == {"filename": str(tmp_path / "test.json")}
assert pipeline.ctx.graph is None, "DataHubGraph should not be initialized"

@freeze_time(FROZEN_TIME)
Expand Down