File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/dask-task-models-library/tests/container_tasks Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ def test_create_task_output_from_task_ignores_additional_entries(
204204 # Add more data to the output file to simulate additional entries
205205 file_path = tmp_path / output_file
206206 data = json .loads (file_path .read_text ())
207+ # Ensure the file contains the expected keys first
208+ for key in task_output_schema :
209+ assert key in data
210+ # Add an extra key
207211 data ["extra_key" ] = "extra_value"
208212 file_path .write_text (json .dumps (data ))
209213
@@ -212,4 +216,7 @@ def test_create_task_output_from_task_ignores_additional_entries(
212216 output_folder = tmp_path ,
213217 output_file_ext = output_file ,
214218 )
215- assert len (task_output_data ) == 2 , "Should only contain the expected keys"
219+ # Only keys defined in the schema should be present
220+ assert set (task_output_data .keys ()) == set (
221+ task_output_schema .keys ()
222+ ), "Should only contain the expected keys"
You can’t perform that action at this time.
0 commit comments