docstr: Directory and parts.
docstr_tok: ["Directory","and","parts","."]
code: def test_dir(self, invocation_path: Path) -> None:
      """Directory and parts."""
      assert resolve_collection_argument(
          invocation_path, "src/pkg"
      ) == (
          invocation_path / "src/pkg",
          [],
      )
  
      with pytest.raises(
          UsageError,
          match=r"directory argument cannot contain :: selection parts",
      ):
          resolve_collection_argument(invocation_path, "src/pkg::")
  
      with pytest.raises(
          UsageError,
          match=r"directory argument cannot contain :: selection parts",
      ):
          resolve_collection_argument(
              invocation_path, "src/pkg::foo::bar"
          )
  
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 3 for calling the TestResolveCollectionArgument obj's underlying member method code with example usage: obj.test_dir(invocation_path) without return types