docstr: Emitter checks source stack
docstr_tok: ["Emitter","checks","source","stack"]
code: def test_source_stack_integrity(self):
      """Emitter checks source stack"""
      em = EventEmitter(type="test_event")
  
      def cb(ev):
          ev._sources.append("x")
  
      em.connect(cb)
  
      try:
          em()
      except RuntimeError as err:
          if str(err) != "Event source-stack mismatch.":
              raise
  
      em.disconnect()
  
      def cb(ev):
          ev._sources = []
  
      em.connect(cb)
  
      try:
          em()
      except IndexError:
          pass
  
imports: import unittest
  import copy
  import functools
  from vispy.util.event import Event, EventEmitter
  from vispy.testing import run_tests_if_main, assert_raises, assert_equal
label_desc: Use image node_id 17 for calling the TestEmitters obj's underlying member method code with example usage: obj.test_source_stack_integrity() without return types