def wait_ready(self) -> None:
        """Wait until a request to ``/ensure`` is successful, indicating the
        server has started and is listening.
        """
        while True:
            try:
                self.request("/ensure")
                return
            # ConnectionRefusedError for http, FileNotFoundError for unix
            except (ConnectionRefusedError, FileNotFoundError):
                time.sleep(0.1)
Wait until a request to ``/ensure`` is successful, indicating the
        server has started and is listening.
        
tests/conftest.py