'Test that error in inner middleware leaves'

def test_inner_mw_throw_exception(self):

    global context
    class RaiseErrorMiddleware(object, ):
        def process_request(self, req, resp):
            raise Exception('Always    fail')
    app = falcon.API(middleware=[TransactionIdMiddleware(), RequestTimeMiddleware(), RaiseErrorMiddleware()])
    app.add_route(TEST_ROUTE, MiddlewareClassResource())
    client = testing.TestClient(app)
    with pytest.raises(Exception):
        client.simulate_request(path=TEST_ROUTE)
    assert ('transaction_id' in context)
    assert ('start_time' in context)
    assert ('mid_time' not in context)
    assert ('end_time' in context)
