def METHOD_NAME(tmp_path):
    path = f"{tmp_path}/test-lock-{uuid.uuid4()}"
    # initialise lock
    lock = Lock.singleton(path)
    assert not lock.locked()
    # try to release lock, will fail because it is not acquired
    with pytest.raises(RuntimeError):
        lock.release()
    # acquire lock from different process
    cmd = (
        "import time; from maestral.daemon import Lock; "
        f"l = Lock.singleton({path!r}); l.acquire(); "
        "time.sleep(60);"
    )
    p = subprocess.Popen([sys.executable, "-c", cmd])
    time.sleep(1)
    # check that lock is acquired
    assert lock.locked()
    # try to re-acquire
    res = lock.acquire()
    assert not res
    assert lock.locked()
    # try to release lock, will fail because it is owned by a different process
    with pytest.raises(RuntimeError):
        lock.release()
    # check pid of locking process
    assert lock.locking_pid() == p.pid
    # release lock by terminating process
    p.terminate()
    p.wait()
    assert not lock.locked()