1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
import pytest
from pathlib import Path
from trame_client.utils.testing import FixtureHelper
ROOT_PATH = Path(__file__).parent.parent.absolute()
HELPER = FixtureHelper(ROOT_PATH)
@pytest.fixture
def ref_dir() -> Path:
return Path(__file__).parent / "refs"
@pytest.fixture
def server(xprocess, server_path):
name, Starter, Monitor = HELPER.get_xprocess_args(server_path)
# ensure process is running and return its logfile
logfile = xprocess.ensure(name, Starter)
yield Monitor(logfile[1])
# clean up whole process tree afterwards
xprocess.getinfo(name).terminate()
|