human
Complete this python program:
def expect_failure_with_message(message):
assistant
#Here is the Python code you requested.

    """Ensure the test raises an exception and does not emit an event
    """
    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