Start of integration tests

This commit is contained in:
Donkie
2023-05-18 14:38:28 +02:00
parent d3703d0d92
commit c6ee7df535
8 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
"""Test fixtures for integration tests."""
import time
import httpx
import pytest
TIMEOUT = 10
@pytest.fixture(scope="session", autouse=True)
def _wait_for_server(): # noqa: ANN202
"""Wait for the server to start up."""
start_time = time.time()
while True:
try:
response = httpx.get("http://spoolman:8000")
response.raise_for_status()
except httpx.HTTPError:
if time.time() - start_time > TIMEOUT:
raise
else:
break