'Test than an invalid class can not be added as middleware'

def test_add_invalid_middleware(self):

    class InvalidMiddleware:
        def process_request(self, *args):
            pass
    mw_list = [RequestTimeMiddleware(), InvalidMiddleware]
    with pytest.raises(AttributeError):
        falcon.API(middleware=mw_list)
    mw_list = [RequestTimeMiddleware(), 'InvalidMiddleware']
    with pytest.raises(TypeError):
        falcon.API(middleware=mw_list)
    mw_list = [{'process_request': 90}]
    with pytest.raises(TypeError):
        falcon.API(middleware=mw_list)
