You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
01/software/source/server/conftest.py

37 lines
778 B

# tests currently hang after completion
"""
import pytest
import signal
import os
from .profiles.default import interpreter
from async_interpreter import AsyncInterpreter
from fastapi.testclient import TestClient
from .async_server import app
@pytest.fixture
def client():
return TestClient(app)
@pytest.fixture
def mock_interpreter():
async_interpreter = AsyncInterpreter(interpreter)
yield async_interpreter
async_interpreter.shutdown()
@pytest.fixture(scope="function", autouse=True)
def term_handler():
orig = signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGINT))
yield
signal.signal(signal.SIGTERM, orig)
yield
# Send SIGTERM signal to the current process and its children
os.kill(os.getpid(), signal.SIGTERM)
"""