'If C{assertRaises} is used to create a context manager and the wrong
exception type is raised from the body of the C{with} statement then
the C{with} statement raises C{failureException} describing the
mismatch.'

def test_assertRaisesContextUnexpected(self):

    try:
        with self.assertRaises(ValueError):
            raise TypeError('marker')
    except self.failureException as exception:
        message = str(exception)
        expected = '{type}    raised    instead    of    ValueError:\n    Traceback'.format(type=fullyQualifiedName(TypeError))
        self.assertTrue(message.startswith(expected), 'Exception    message    did    not    begin    with    expected    information:    {0}'.format(message))
    else:
        self.fail('Mismatched    exception    type    should    have    caused    test    failure.')
