docstr: Takes valid non-deprecated inputs for converters,
  runs converters on inputs, checks correctness of outputs,
  warnings and errors
docstr_tok: ["Takes","valid","non-deprecated","inputs","for","converters",",","runs","converters","on","inputs",",","checks","correctness","of","outputs",",","warnings","and","errors"]
code: def _check(self, val, expected):
      """Takes valid non-deprecated inputs for converters,
      runs converters on inputs, checks correctness of outputs,
      warnings and errors"""
      assert self.conv(val) == expected
  
      if self.allow_bytes:
          assert self.conv(val.encode("ascii")) == expected
      else:
          with pytest.raises(TypeError):
              self.conv(val.encode("ascii"))
  
      if len(val) != 1:
          if self.exact_match:
              self._check_value_error(val[:1])
              self._check_value_error(val + "\0")
          else:
              self._check_conv_assert_warn(val[:1], expected)
  
      if self.case_insensitive:
          if val != val.lower():
              self._check_conv_assert_warn(val.lower(), expected)
          if val != val.upper():
              self._check_conv_assert_warn(val.upper(), expected)
      else:
          if val != val.lower():
              self._check_value_error(val.lower())
          if val != val.upper():
              self._check_value_error(val.upper())
  
imports: import re
  import sys
  import pytest
  import numpy
  import numpy.core._multiarray_tests
  from numpy.testing import assert_warns, IS_PYPY
label_desc: Use image node_id 3 for calling the StringConverterTestCase obj's underlying member method code with example usage: obj._check(val, expected) without return types