code: def test_rwlock_edit_is_guarded(tmp_path, mocker):
      # patching to speedup tests
      mocker.patch("dvc.lock.DEFAULT_TIMEOUT", 0.01)
  
      path = os.fspath(tmp_path)
  
      with _edit_rwlock(path, localfs, False):
          with pytest.raises(LockError):
              with _edit_rwlock(path, localfs, False):
                  pass
  
file_path: dvc/tests/unit/test_rwlock.py
imports: import json
  import os
  import pytest
  from dvc.fs import localfs
  from dvc.lock import LockError
  from dvc.rwlock import RWLockFileCorruptedError, RWLockFileFormatError, _edit_rwlock, rwlock
label_desc: Use image node_id 3 for calling a global function with example usage: test_rwlock_edit_is_guarded(tmp_path, mocker) without return types