Further test simplifications

This commit is contained in:
Matthias
2023-11-05 16:15:36 +01:00
parent eb409de916
commit 7bed7801cc
4 changed files with 29 additions and 32 deletions

View File

@@ -104,8 +104,8 @@ def test_load_config_file_error_range(default_conf, mocker, caplog) -> None:
assert x == ''
def test_load_file_error(tmpdir):
testpath = Path(tmpdir) / 'config.json'
def test_load_file_error(tmp_path):
testpath = tmp_path / 'config.json'
with pytest.raises(OperationalException, match=r"File .* not found!"):
load_file(testpath)
@@ -1145,7 +1145,7 @@ def test_pairlist_resolving_with_config_pl_not_exists(mocker, default_conf):
configuration.get_config()
def test_pairlist_resolving_fallback(mocker, tmpdir):
def test_pairlist_resolving_fallback(mocker, tmp_path):
mocker.patch.object(Path, "exists", MagicMock(return_value=True))
mocker.patch.object(Path, "open", MagicMock(return_value=MagicMock()))
mocker.patch("freqtrade.configuration.configuration.load_file",
@@ -1164,7 +1164,7 @@ def test_pairlist_resolving_fallback(mocker, tmpdir):
assert config['pairs'] == ['ETH/BTC', 'XRP/BTC']
assert config['exchange']['name'] == 'binance'
assert config['datadir'] == Path(tmpdir) / "user_data/data/binance"
assert config['datadir'] == tmp_path / "user_data/data/binance"
@pytest.mark.parametrize("setting", [