mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
python: Simplify stdio flushing using print(…, flush=True).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
d8adeb66ca
commit
342834ee9c
@@ -78,18 +78,17 @@ def test_server_running(
|
||||
|
||||
try:
|
||||
# Wait for the server to start up.
|
||||
sys.stdout.write("\nWaiting for test server (may take a while)")
|
||||
print(end="\nWaiting for test server (may take a while)")
|
||||
if not dots:
|
||||
sys.stdout.write("\n\n")
|
||||
print("\n", flush=True)
|
||||
t = time.time()
|
||||
while not server_is_up(server, log_file):
|
||||
if dots:
|
||||
sys.stdout.write(".")
|
||||
sys.stdout.flush()
|
||||
print(end=".", flush=True)
|
||||
time.sleep(0.4)
|
||||
if time.time() - t > MAX_SERVER_WAIT:
|
||||
raise Exception("Timeout waiting for server")
|
||||
sys.stdout.write("\n\n--- SERVER IS UP! ---\n\n")
|
||||
print("\n\n--- SERVER IS UP! ---\n", flush=True)
|
||||
|
||||
# DO OUR ACTUAL TESTING HERE!!!
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user