@@ -128,15 +128,15 @@ def assert_new_env(result, new_env="prod", from_env="prod", initialize=True) ->
128128
129129
130130def assert_model_versions_created (result ) -> None :
131- assert "All model versions have been created successfully" in result .output
131+ assert "Model versions created successfully" in result .output
132132
133133
134134def assert_model_batches_executed (result ) -> None :
135- assert "All model batches have been executed successfully" in result .output
135+ assert "Model batches executed successfully" in result .output
136136
137137
138138def assert_target_env_updated (result ) -> None :
139- assert "The target environment has been updated successfully" in result .output
139+ assert "Target environment updated successfully" in result .output
140140
141141
142142def assert_backfill_success (result ) -> None :
@@ -244,7 +244,7 @@ def test_plan_skip_backfill(runner, tmp_path, flag):
244244 )
245245 assert result .exit_code == 0
246246 assert_virtual_update (result )
247- assert "All model batches have been executed successfully" not in result .output
247+ assert "Model batches executed successfully" not in result .output
248248
249249
250250def test_plan_auto_apply (runner , tmp_path ):
@@ -450,8 +450,8 @@ def test_plan_dev_no_prompts(runner, tmp_path):
450450 cli , ["--log-file-dir" , tmp_path , "--paths" , tmp_path , "plan" , "dev" , "--no-prompts" ]
451451 )
452452 assert "Apply - Backfill Tables [y/n]: " in result .output
453- assert "All model versions have been created successfully" not in result .output
454- assert "All model batches have been executed successfully" not in result .output
453+ assert "Model versions created successfully" not in result .output
454+ assert "Model batches executed successfully" not in result .output
455455 assert "The target environment has been updated successfully" not in result .output
456456
457457
@@ -896,50 +896,51 @@ def test_plan_dlt(runner, tmp_path):
896896 assert incremental_model == expected_incremental_model
897897 assert nested_model == expected_nested_fillings_model
898898
899- # Plan prod and backfill
900- result = runner .invoke (
901- cli , ["--log-file-dir" , tmp_path , "--paths" , tmp_path , "plan" , "--auto-apply" ]
902- )
903-
904- assert result .exit_code == 0
905- assert_backfill_success (result )
906-
907- # Remove and update with missing model
908- remove (dlt_waiters_model_path )
909- assert not dlt_waiters_model_path .exists ()
910-
911- # Update with force = False will generate only the missing model
912- context = Context (paths = tmp_path )
913- assert generate_dlt_models (context , "sushi" , [], False ) == [
914- "sushi_dataset_sqlmesh.incremental_waiters"
915- ]
916- assert dlt_waiters_model_path .exists ()
917-
918- # Remove all models
919- remove (dlt_waiters_model_path )
920- remove (dlt_loads_model_path )
921- remove (dlt_sushi_types_model_path )
922- remove (dlt_sushi_fillings_model_path )
923- remove (dlt_sushi_twice_nested_model_path )
924-
925- # Update to generate a specific model: sushi_types
926- assert generate_dlt_models (context , "sushi" , ["sushi_types" ], False ) == [
927- "sushi_dataset_sqlmesh.incremental_sushi_types"
928- ]
929-
930- # Only the sushi_types should be generated now
931- assert not dlt_waiters_model_path .exists ()
932- assert not dlt_loads_model_path .exists ()
933- assert not dlt_sushi_fillings_model_path .exists ()
934- assert not dlt_sushi_twice_nested_model_path .exists ()
935- assert dlt_sushi_types_model_path .exists ()
936-
937- # Update with force = True will generate all models and overwrite existing ones
938- generate_dlt_models (context , "sushi" , [], True )
939- assert dlt_loads_model_path .exists ()
940- assert dlt_sushi_types_model_path .exists ()
941- assert dlt_waiters_model_path .exists ()
942- assert dlt_sushi_fillings_model_path .exists ()
943- assert dlt_sushi_twice_nested_model_path .exists ()
899+ try :
900+ # Plan prod and backfill
901+ result = runner .invoke (
902+ cli , ["--log-file-dir" , tmp_path , "--paths" , tmp_path , "plan" , "--auto-apply" ]
903+ )
944904
945- remove (dataset_path )
905+ assert result .exit_code == 0
906+ assert_backfill_success (result )
907+
908+ # Remove and update with missing model
909+ remove (dlt_waiters_model_path )
910+ assert not dlt_waiters_model_path .exists ()
911+
912+ # Update with force = False will generate only the missing model
913+ context = Context (paths = tmp_path )
914+ assert generate_dlt_models (context , "sushi" , [], False ) == [
915+ "sushi_dataset_sqlmesh.incremental_waiters"
916+ ]
917+ assert dlt_waiters_model_path .exists ()
918+
919+ # Remove all models
920+ remove (dlt_waiters_model_path )
921+ remove (dlt_loads_model_path )
922+ remove (dlt_sushi_types_model_path )
923+ remove (dlt_sushi_fillings_model_path )
924+ remove (dlt_sushi_twice_nested_model_path )
925+
926+ # Update to generate a specific model: sushi_types
927+ assert generate_dlt_models (context , "sushi" , ["sushi_types" ], False ) == [
928+ "sushi_dataset_sqlmesh.incremental_sushi_types"
929+ ]
930+
931+ # Only the sushi_types should be generated now
932+ assert not dlt_waiters_model_path .exists ()
933+ assert not dlt_loads_model_path .exists ()
934+ assert not dlt_sushi_fillings_model_path .exists ()
935+ assert not dlt_sushi_twice_nested_model_path .exists ()
936+ assert dlt_sushi_types_model_path .exists ()
937+
938+ # Update with force = True will generate all models and overwrite existing ones
939+ generate_dlt_models (context , "sushi" , [], True )
940+ assert dlt_loads_model_path .exists ()
941+ assert dlt_sushi_types_model_path .exists ()
942+ assert dlt_waiters_model_path .exists ()
943+ assert dlt_sushi_fillings_model_path .exists ()
944+ assert dlt_sushi_twice_nested_model_path .exists ()
945+ finally :
946+ remove (dataset_path )
0 commit comments