We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aed1fbe commit 9b75437Copy full SHA for 9b75437
1 file changed
tests/test_notifier.py
@@ -36,19 +36,10 @@ def start_server():
36
flask_process = Process(target=run_server, args=(queue,))
37
flask_process.start()
38
39
- timeout = 60 # wait maximum of 60 seconds
40
- while True:
41
- try:
42
- response = requests.get(WEBHOOK_SERVER_URL, timeout=1_000)
43
- if response.status_code == 200: # Or another condition
44
- break
45
- except (requests.ConnectionError, socket.error):
46
- time.sleep(1) # wait for 1 second before trying again
47
- timeout -= 1
48
- if timeout == 0:
49
- pytest.fail("Server did not start in the expected time")
50
-
51
- yield # This is where the testing happens.
+ response = requests.get(WEBHOOK_SERVER_URL, timeout=3)
+ response.raise_for_status()
+
+ yield
52
53
flask_process.terminate()
54
0 commit comments