Remove further usages of Path(tmpdir)

This commit is contained in:
Matthias
2023-11-05 16:25:23 +01:00
parent 555f4b51e1
commit 5a3839320d
5 changed files with 33 additions and 33 deletions

View File

@@ -550,7 +550,7 @@ def test_start_install_ui(mocker):
assert download_mock.call_count == 0
def test_clean_ui_subdir(mocker, tmpdir, caplog):
def test_clean_ui_subdir(mocker, tmp_path, caplog):
mocker.patch("freqtrade.commands.deploy_commands.Path.is_dir",
side_effect=[True, True])
mocker.patch("freqtrade.commands.deploy_commands.Path.is_file",
@@ -560,14 +560,14 @@ def test_clean_ui_subdir(mocker, tmpdir, caplog):
mocker.patch("freqtrade.commands.deploy_commands.Path.glob",
return_value=[Path('test1'), Path('test2'), Path('.gitkeep')])
folder = Path(tmpdir) / "uitests"
folder = tmp_path / "uitests"
clean_ui_subdir(folder)
assert log_has("Removing UI directory content.", caplog)
assert rd_mock.call_count == 1
assert ul_mock.call_count == 1
def test_download_and_install_ui(mocker, tmpdir):
def test_download_and_install_ui(mocker, tmp_path):
# Create zipfile
requests_mock = MagicMock()
file_like_object = BytesIO()
@@ -583,7 +583,7 @@ def test_download_and_install_ui(mocker, tmpdir):
side_effect=[True, False])
wb_mock = mocker.patch("freqtrade.commands.deploy_commands.Path.write_bytes")
folder = Path(tmpdir) / "uitests_dl"
folder = tmp_path / "uitests_dl"
folder.mkdir(exist_ok=True)
assert read_ui_version(folder) is None
@@ -1010,8 +1010,8 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys):
pytest.fail(f'Expected well formed JSON, but failed to parse: {captured.out}')
def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, tmpdir):
csv_file = Path(tmpdir) / "test.csv"
def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, tmp_path):
csv_file = tmp_path / "test.csv"
mocker.patch(
'freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist',
return_value=True