def expect_failure_with_message(message):
 def test_decorator(func):
  def test_decorated(self, *args, **kwargs):
   self.assertRaisesRegexp(segmentio.EventValidationError, message, func, self, *args, **kwargs)
   self.assert_no_events_emitted()
  return test_decorated
 return test_decorator

def expect_failure_with_message ( message ) : def test_decorator ( func ) : def test_decorated ( self , * args , ** kwargs ) : self . assertRaisesRegexp ( segmentio . EventValidationError , message , func , self , * args , ** kwargs ) self . assert_no_events_emitted ( ) return test_decorated return test_decorator
ensure the test raises an exception and does not emit an event .