File: conftest.py

package info (click to toggle)
python-trame-client 3.10.4-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 3,128 kB
  • sloc: python: 9,583; javascript: 3,897; sh: 9; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (2)
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()