code: def test_with(tmp_dir, dvc, mocker):
      # patching to speedup tests
      mocker.patch("dvc.lock.DEFAULT_TIMEOUT", 0.01)
  
      lockfile = tmp_dir / dvc.tmp_dir / "lock"
      with Lock(lockfile):
          with pytest.raises(LockError), Lock(lockfile):
              pass
  
file_path: dvc/tests/func/test_lock.py
imports: import pytest
  from dvc.cli import main
  from dvc.exceptions import DvcException
  from dvc.lock import Lock, LockError
label_desc: Use image node_id 1 for calling a global function with example usage: test_with(tmp_dir, dvc, mocker) without return types