code: def pytest_sessionfinish(session, exitstatus):
      # This hook is called after all tests have run, and just before returning an exit status.
      # We here change exit code 5 into 0.
      #
      # 5 is issued when no tests were actually run, e.g. if you use `pytest -k some_regex_that_is_never_matched`.
      #
      # Having no test being run for a given test rule is a common scenario in fbcode, and typically happens on
      # the GPU test machines which don't run the CPU-only tests (see pytest_collection_modifyitems above). For
      # example `test_transforms.py` doesn't contain any CUDA test at the time of
      # writing, so on a GPU test machine, testpilot would invoke pytest on this file and no test would be run.
      # This would result in pytest returning 5, causing testpilot to raise an error.
      # To avoid this, we transform this 5 into a 0 to make testpilot happy.
      if exitstatus == 5:
          session.exitstatus = 0
  
file_path: vision/test/conftest.py
imports: import random
  import numpy
  import pytest
  import torch
  from common_utils import CUDA_NOT_AVAILABLE_MSG, IN_FBCODE, IN_OSS_CI, IN_RE_WORKER, MPS_NOT_AVAILABLE_MSG, OSS_CI_GPU_NO_CUDA_MSG
label_desc: Use image node_id 3 for calling a global function with example usage: pytest_sessionfinish(session, exitstatus) without return types