diff --git a/tests/test_configuration.py b/tests/test_configuration.py index c081da89f..f9368246a 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -509,7 +509,7 @@ def test_setup_configuration_with_arguments(mocker, default_conf, caplog, tmp_pa assert "pair_whitelist" in config["exchange"] assert "datadir" in config assert log_has("Using data directory: {} ...".format("/foo/bar"), caplog) - assert log_has(f"Using user-data directory: {tmp_path}/freqtrade ...", caplog) + assert log_has(f"Using user-data directory: {tmp_path / 'freqtrade'} ...", caplog) assert "user_data_dir" in config assert "timeframe" in config diff --git a/tests/test_directory_operations.py b/tests/test_directory_operations.py index a6216f7a6..0b718060c 100644 --- a/tests/test_directory_operations.py +++ b/tests/test_directory_operations.py @@ -28,10 +28,10 @@ def test_create_userdata_dir(mocker, tmp_path, caplog) -> None: mocker.patch.object(Path, "is_dir", MagicMock(return_value=False)) md = mocker.patch.object(Path, "mkdir", MagicMock()) - x = create_userdata_dir(f"{tmp_path}/bar", create_dir=True) + x = create_userdata_dir(tmp_path / "bar", create_dir=True) assert md.call_count == 10 assert md.call_args[1]["parents"] is False - assert log_has(f'Created user-data directory: {f"{tmp_path}/bar"}', caplog) + assert log_has(f'Created user-data directory: {tmp_path / "bar"}', caplog) assert isinstance(x, Path) assert str(x) == f"{tmp_path}/bar" @@ -78,7 +78,7 @@ def test_copy_sample_files(mocker, tmp_path) -> None: copy_sample_files(Path(f"{tmp_path}/bar")) assert copymock.call_count == 3 - assert copymock.call_args_list[0][0][1] == str(f"{tmp_path}/bar/strategies/sample_strategy.py") + assert copymock.call_args_list[0][0][1] == str(tmp_path / "bar/strategies/sample_strategy.py") assert copymock.call_args_list[1][0][1] == str( f"{tmp_path}/bar/hyperopts/sample_hyperopt_loss.py" )