diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index 389cdb11e..dc592fd8b 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -191,7 +191,10 @@ def test_start_no_data(mocker, hyperopt_conf) -> None: start_hyperopt(pargs) # Cleanup since that failed hyperopt start leaves a lockfile. - Path(Hyperopt.get_lock_filename(hyperopt_conf)).unlink(missing_ok=True) + try: + Path(Hyperopt.get_lock_filename(hyperopt_conf)).unlink(missing_ok=True) + except Exception: + pass def test_start_filelock(mocker, hyperopt_conf, caplog) -> None: