2828@pytest .fixture (scope = "session" )
2929def yaml_config_path (tmp_path_factory ) -> Path :
3030 config_path = tmp_path_factory .mktemp ("yaml_config" ) / "config.yaml"
31- with open (config_path , "w" ) as fd :
31+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
3232 fd .write (
3333 """
3434gateways:
@@ -47,7 +47,7 @@ def yaml_config_path(tmp_path_factory) -> Path:
4747@pytest .fixture (scope = "session" )
4848def python_config_path (tmp_path_factory ) -> Path :
4949 config_path = tmp_path_factory .mktemp ("python_config" ) / "config.py"
50- with open (config_path , "w" ) as fd :
50+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
5151 fd .write (
5252 """from sqlmesh.core.config import Config, DuckDBConnectionConfig, GatewayConfig, ModelDefaultsConfig
5353config = Config(gateways=GatewayConfig(connection=DuckDBConnectionConfig()), model_defaults=ModelDefaultsConfig(dialect=''))
@@ -163,11 +163,11 @@ def test_load_config_from_paths(yaml_config_path: Path, python_config_path: Path
163163
164164def test_load_config_multiple_config_files_in_folder (tmp_path ):
165165 config_a_path = tmp_path / "config.yaml"
166- with open (config_a_path , "w" ) as fd :
166+ with open (config_a_path , "w" , encoding = "utf-8" ) as fd :
167167 fd .write ("project: project_a" )
168168
169169 config_b_path = tmp_path / "config.yml"
170- with open (config_b_path , "w" ) as fd :
170+ with open (config_b_path , "w" , encoding = "utf-8" ) as fd :
171171 fd .write ("project: project_b" )
172172
173173 with pytest .raises (ConfigError , match = r"^Multiple configuration files found in folder.*" ):
@@ -285,7 +285,7 @@ def test_load_config_from_env_invalid_variable_name():
285285
286286def test_load_config_from_python_module_missing_config (tmp_path ):
287287 config_path = tmp_path / "missing_config.py"
288- with open (config_path , "w" ) as fd :
288+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
289289 fd .write ("from sqlmesh.core.config import Config" )
290290
291291 with pytest .raises (ConfigError , match = "Config 'config' was not found." ):
@@ -294,7 +294,7 @@ def test_load_config_from_python_module_missing_config(tmp_path):
294294
295295def test_load_config_from_python_module_invalid_config_object (tmp_path ):
296296 config_path = tmp_path / "invalid_config.py"
297- with open (config_path , "w" ) as fd :
297+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
298298 fd .write ("config = None" )
299299
300300 with pytest .raises (
@@ -306,7 +306,7 @@ def test_load_config_from_python_module_invalid_config_object(tmp_path):
306306
307307def test_cloud_composer_scheduler_config (tmp_path_factory ):
308308 config_path = tmp_path_factory .mktemp ("yaml_config" ) / "config.yaml"
309- with open (config_path , "w" ) as fd :
309+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
310310 fd .write (
311311 """
312312gateways:
@@ -365,7 +365,7 @@ def test_cloud_composer_scheduler_config(tmp_path_factory):
365365)
366366def test_environment_catalog_mapping (tmp_path_factory , mapping , expected , dialect , raise_error ):
367367 config_path = tmp_path_factory .mktemp ("yaml_config" ) / "config.yaml"
368- with open (config_path , "w" ) as fd :
368+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
369369 fd .write (
370370 f"""
371371gateways:
@@ -395,7 +395,7 @@ def test_environment_catalog_mapping(tmp_path_factory, mapping, expected, dialec
395395
396396def test_load_feature_flag (tmp_path_factory ):
397397 config_path = tmp_path_factory .mktemp ("yaml_config" ) / "config.yaml"
398- with open (config_path , "w" ) as fd :
398+ with open (config_path , "w" , encoding = "utf-8" ) as fd :
399399 fd .write (
400400 """
401401gateways:
0 commit comments