def METHOD_NAME(self, sleep):
    sock1, sock2 = socket.socketpair()
    try:
        p = gevent.spawn(util.wrap_errors(AssertionError,
                                          socket.wait_read), # pylint:disable=no-member
                         sock1.fileno())
        gevent.get_hub().loop.run_callback(switch_None, p)
        if sleep is not None:
            gevent.sleep(sleep)
        result = p.get()
        assert isinstance(result, AssertionError), result
        assert 'Invalid switch' in str(result), repr(str(result))
    finally:
        sock1.close()
        sock2.close()