class_docstr: Helper class to test exception raising
class_docstr_tok: ["Helper","class","to","test","exception","raising"]
code: def __exit__(self, exc_typ, exc, tb):
      if isinstance(exc, self.exc):
          return True
      elif exc is None:
          raise AssertionError(
              "Expected %s (no exception raised)" % self.exc.__name__
          )
      else:
          raise AssertionError(
              "Expected %s, got %s instead (%s)"
              % (self.exc.__name__, type(exc).__name__, exc)
          )
  
imports: from __future__ import print_function
  import numpy
  import sys
  import os
  import inspect
  import gc
  import pytest
  import functools
  from packaging.version import Version
  from ..util.check_environment import has_backend
label_desc: Use image node_id 3 for calling the raises obj's underlying member method code with example usage: obj.__exit__(exc_typ, exc, tb) and returns: True