def test_assertRaisesWithCallableUnexpectedException(self):
        """When given a callable that raises an unexpected exception,
        HyperlinkTestCase.assertRaises raises that exception.

        """

        def doesNotRaiseExpected(*args, **kwargs):
            raise _UnexpectedException

        try:
            self.hyperlink_test.assertRaises(_ExpectedException,
                                             doesNotRaiseExpected)
        except _UnexpectedException:
            pass
When given a callable that raises an unexpected exception,
        HyperlinkTestCase.assertRaises raises that exception.

        
stackoverflow/venv/lib/python3.6/site-packages/hyperlink/test/test_common.py