docstr: Ensure our function that detects mock arguments compares against sentinels using
  identity to circumvent objects which can't be compared with equality against others
  in a truth context, like with numpy arrays (#5606).
docstr_tok: ["Ensure","our","function","that","detects","mock","arguments","compares","against","sentinels","using","identity","to","circumvent","objects","which","ca","n't","be","compared","with","equality","against","others","in","a","truth","context",",","like","with","numpy","arrays","(","#","5606",")","."]
code: def test_mock_sentinel_check_against_numpy_like(
      self, pytester: Pytester
  ) -> None:
      """Ensure our function that detects mock arguments compares against sentinels using
      identity to circumvent objects which can't be compared with equality against others
      in a truth context, like with numpy arrays (#5606).
      """
      pytester.makepyfile(
          dummy="""
              class NumpyLike:
                  def __init__(self, value):
                      self.value = value
                  def __eq__(self, other):
                      raise ValueError("like numpy, cannot compare against others for truth")
              FOO = NumpyLike(10)
          """
      )
      pytester.makepyfile(
          """
              from unittest.mock import patch
              import dummy
              class Test(object):
                  @patch("dummy.FOO", new=dummy.NumpyLike(50))
                  def test_hello(self):
                      assert dummy.FOO.value == 50
          """
      )
      reprec = pytester.inline_run()
      reprec.assertoutcome(passed=1)
  
imports: import pytest
  from _pytest._code import getfslineno
  from _pytest.fixtures import getfixturemarker
  from _pytest.pytester import Pytester
  from _pytest.python import Function
label_desc: Use image node_id 6 for calling the TestMockDecoration obj's underlying member method code with example usage: obj.test_mock_sentinel_check_against_numpy_like(pytester) without return types