docstr: Emitter constructed with event_class argument
docstr_tok: ["Emitter","constructed","with","event_class","argument"]
code: def test_emitter_type_event_class(self):
      """Emitter constructed with event_class argument"""
      em = EventEmitter(event_class=BasicEvent)
      ev = self.try_emitter(em, type="test_event")
      self.assert_result(
          event=ev,
          event_class=BasicEvent,
          source=None,
          type="test_event",
          sources=[None],
      )
  
      # specifying non-event class should fail (eventually):
      class X:
          def __init__(self, *args, **kwargs):
              self.blocked = False
  
          def _push_source(self, s):
              pass
  
          def _pop_source(self):
              pass
  
      try:
          em = EventEmitter(event_class=X)
          ev = self.try_emitter(em, type="test_event")
          self.assert_result()  # checks event type
          assert (
              False
          ), "Should not be able to construct emitter with non-Event class"
      except Exception:
          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 4 for calling the TestEmitters obj's underlying member method code with example usage: obj.test_emitter_type_event_class() without return types