code: def pytest_error_str(error):
      """Different for different versions of Pytest"""
      try:
          return str(error.value)
      except AttributeError:
          return str(error)
  
imports: import contextlib
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: pytest_error_str(error) and returns: str, str