Lock file is not always left behind so handle it.

This commit is contained in:
Reigo Reinmets 2021-12-23 17:39:43 +02:00
parent bc60139ae3
commit 0c4664e8f4

View File

@ -191,7 +191,11 @@ def test_start_no_data(mocker, hyperopt_conf) -> None:
with pytest.raises(OperationalException, match='No data found. Terminating.'): with pytest.raises(OperationalException, match='No data found. Terminating.'):
start_hyperopt(pargs) start_hyperopt(pargs)
# Cleanup since that failed hyperopt start leaves a lockfile.
try:
os.unlink(Hyperopt.get_lock_filename(hyperopt_conf)) os.unlink(Hyperopt.get_lock_filename(hyperopt_conf))
except Exception:
pass
def test_start_filelock(mocker, hyperopt_conf, caplog) -> None: def test_start_filelock(mocker, hyperopt_conf, caplog) -> None: