def eventWithFailure(self, **values):
        """
        Create a new-style event with a captured failure.

        @param values: Additional values to include in the event.
        @type values: L{dict}

        @return: the new event
        @rtype: L{dict}
        """
        failure = Failure(RuntimeError("nyargh!"))
        return self.forwardAndVerify(dict(
            log_failure=failure,
            log_format="oopsie...",
            **values
        ))

        Create a new-style event with a captured failure.

        @param values: Additional values to include in the event.
        @type values: L{dict}

        @return: the new event
        @rtype: L{dict}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_legacy.py