mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 20:35:06 +08:00
18 lines
491 B
Python
18 lines
491 B
Python
|
import unittest
|
||
|
import requests
|
||
|
import time
|
||
|
|
||
|
timeout_threshold = 240
|
||
|
start_time = time.time()
|
||
|
while time.time()-start_time < timeout_threshold:
|
||
|
try:
|
||
|
requests.head("http://localhost:7860/")
|
||
|
break
|
||
|
except requests.exceptions.ConnectionError:
|
||
|
pass
|
||
|
if time.time()-start_time < timeout_threshold:
|
||
|
suite = unittest.TestLoader().discover('', pattern='*_test.py')
|
||
|
result = unittest.TextTestRunner(verbosity=2).run(suite)
|
||
|
else:
|
||
|
print("Launch unsuccessful")
|