mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-19 21:40:24 +00:00
fix: further fixes for utf8 reading on windows
This commit is contained in:
@@ -2496,7 +2496,9 @@ def test_api_strategy(botclient, tmp_path, mocker):
|
||||
assert_response(rc)
|
||||
assert rc.json()["strategy"] == CURRENT_TEST_STRATEGY
|
||||
|
||||
data = (Path(__file__).parents[1] / "strategy/strats/strategy_test_v3.py").read_text()
|
||||
data = (Path(__file__).parents[1] / "strategy/strats/strategy_test_v3.py").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
assert rc.json()["code"] == data
|
||||
|
||||
rc = client_get(client, f"{BASE_URI}/strategy/NoStrat")
|
||||
|
||||
@@ -15,7 +15,7 @@ def test_strategy_updater_start(user_dir, capsys) -> None:
|
||||
tmpdirp = Path(user_dir) / "strategies"
|
||||
tmpdirp.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy(teststrats / "strategy_test_v2.py", tmpdirp)
|
||||
old_code = (teststrats / "strategy_test_v2.py").read_text()
|
||||
old_code = (teststrats / "strategy_test_v2.py").read_text(encoding="utf-8")
|
||||
|
||||
args = ["strategy-updater", "--userdir", str(user_dir), "--strategy-list", "StrategyTestV2"]
|
||||
pargs = get_args(args)
|
||||
@@ -29,7 +29,7 @@ def test_strategy_updater_start(user_dir, capsys) -> None:
|
||||
# updated file exists
|
||||
new_file = tmpdirp / "strategy_test_v2.py"
|
||||
assert new_file.exists()
|
||||
new_code = new_file.read_text()
|
||||
new_code = new_file.read_text(encoding="utf-8")
|
||||
assert "INTERFACE_VERSION = 3" in new_code
|
||||
assert "INTERFACE_VERSION = 2" in old_code
|
||||
captured = capsys.readouterr()
|
||||
|
||||
Reference in New Issue
Block a user