code: def setup_test_dir(testdir: str | None) -> None:
      if testdir:
          # Prepend test directory to sys.path, so runtest() will be able
          # to locate tests
          sys.path.insert(0, os.path.abspath(testdir))
  
file_path: cpython/Lib/test/libregrtest/setup.py
imports: import faulthandler
  import gc
  import os
  import random
  import signal
  import sys
  import unittest
  from test import support
  from test.support.os_helper import TESTFN_UNDECODABLE, FS_NONASCII
  from .filter import set_match_tests
  from .runtests import RunTests
  from .utils import setup_unraisable_hook, setup_threading_excepthook, fix_umask, adjust_rlimit_nofile
label_desc: Use image node_id 1 for calling a global function with example usage: setup_test_dir(testdir) without return types