Assert text files are in utf8 (#350)

Read and write text files with utf8 encoding.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2025-01-07 19:31:44 +01:00
committed by GitHub
parent ef60f5b9f5
commit d2f6e9866d
7 changed files with 14 additions and 14 deletions

View File

@@ -61,7 +61,7 @@ def sample_settings(config_eos):
@pytest.fixture
def sample_forecast_data():
"""Fixture that returns sample forecast data converted to pydantic model."""
with open(FILE_TESTDATA_PV_FORECAST_INPUT_1, "r") as f_in:
with open(FILE_TESTDATA_PV_FORECAST_INPUT_1, "r", encoding="utf8") as f_in:
input_data = f_in.read()
return PVForecastAkkudoktor._validate_data(input_data)
@@ -69,7 +69,7 @@ def sample_forecast_data():
@pytest.fixture
def sample_forecast_data_raw():
"""Fixture that returns raw sample forecast data."""
with open(FILE_TESTDATA_PV_FORECAST_INPUT_1, "r") as f_in:
with open(FILE_TESTDATA_PV_FORECAST_INPUT_1, "r", encoding="utf8") as f_in:
input_data = f_in.read()
return input_data
@@ -77,7 +77,7 @@ def sample_forecast_data_raw():
@pytest.fixture
def sample_forecast_report():
"""Fixture that returns sample forecast data report."""
with open(FILE_TESTDATA_PV_FORECAST_RESULT_1, "r") as f_res:
with open(FILE_TESTDATA_PV_FORECAST_RESULT_1, "r", encoding="utf8") as f_res:
input_data = f_res.read()
return input_data