Skip to content

Instantly share code, notes, and snippets.

@jakubczaplicki
Created February 14, 2018 11:20
Show Gist options
  • Save jakubczaplicki/4aa16c9e58fd4f5c3ff315d7c42f51e9 to your computer and use it in GitHub Desktop.
Save jakubczaplicki/4aa16c9e58fd4f5c3ff315d7c42f51e9 to your computer and use it in GitHub Desktop.
wait for server
start = time.time()
r = requests.get(cls.base_url)
while r.status_code != 200:
print("Server not ready..")
if time.time() - start > 3:
raise RuntimeError("Failed to Start Server")
time.sleep(0.01)
r = requests.get(cls.base_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment