def test_trapRaisesSelf(self):
        """
        If the wrapped C{Exception} is not a subclass of one of the
        expected types, L{failure.Failure.trap} raises itself.
        """
        if _PY3:
            raise SkipTest(
                """
                Only expected behaviour on Python 2.
                @see U{http://twisted.readthedocs.io/en/latest/core/howto/python3.html#twisted-python-failure}
                """
            )

        exception = ValueError()
        try:
            raise exception
        except:
            f = failure.Failure()

        untrapped = self.assertRaises(failure.Failure, f.trap, OverflowError)
        self.assertIs(f, untrapped)

        If the wrapped C{Exception} is not a subclass of one of the
        expected types, L{failure.Failure.trap} raises itself.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_failure.py