code: def wrap_assert_methods(config):
      """
      Wrap assert methods of mock module so we can hide their traceback and
      add introspection information to specified argument asserts.
      """
      # Make sure we only do this once
      if _mock_module_originals:
          return
  
      mock_module = _get_mock_module(config)
  
      wrappers = {
          "assert_called": wrap_assert_called,
          "assert_called_once": wrap_assert_called_once,
          "assert_called_with": wrap_assert_called_with,
          "assert_called_once_with": wrap_assert_called_once_with,
          "assert_any_call": wrap_assert_any_call,
          "assert_has_calls": wrap_assert_has_calls,
          "assert_not_called": wrap_assert_not_called,
      }
      for method, wrapper in wrappers.items():
          try:
              original = getattr(mock_module.NonCallableMock, method)
          except AttributeError:  # pragma: no cover
              continue
          _mock_module_originals[method] = original
          patcher = mock_module.patch.object(
              mock_module.NonCallableMock, method, wrapper
          )
          patcher.start()
          _mock_module_patches.append(patcher)
  
      if hasattr(config, "add_cleanup"):
          add_cleanup = config.add_cleanup
      else:
          # pytest 2.7 compatibility
          add_cleanup = config._cleanup.append
      add_cleanup(unwrap_assert_methods)
  
imports: from __future__ import unicode_literals
  import functools
  import inspect
  import sys
  import pytest
  import six
  from ._version import version
label_desc: Use image node_id 11 for calling a global function with example usage: wrap_assert_methods(config) without return types