docstr: Given a file/module that does not exist raises UsageError.
docstr_tok: ["Given","a","file\/module","that","does","not","exist","raises","UsageError","."]
code: def test_does_not_exist(self, invocation_path: Path) -> None:
      """Given a file/module that does not exist raises UsageError."""
      with pytest.raises(
          UsageError,
          match=re.escape("file or directory not found: foobar"),
      ):
          resolve_collection_argument(invocation_path, "foobar")
  
      with pytest.raises(
          UsageError,
          match=re.escape(
              "module or package not found: foobar (missing __init__.py?)"
          ),
      ):
          resolve_collection_argument(
              invocation_path, "foobar", as_pypath=True
          )
  
imports: import argparse
  import os
  import re
  import sys
  from pathlib import Path
  from typing import Optional
  import pytest
  from _pytest.config import ExitCode
  from _pytest.config import UsageError
  from _pytest.main import resolve_collection_argument
  from _pytest.main import validate_basetemp
  from _pytest.pytester import Pytester
label_desc: Use image node_id 6 for calling the TestResolveCollectionArgument obj's underlying member method code with example usage: obj.test_does_not_exist(invocation_path) without return types