Skip to main content

tests/conftest.py

1import os
2import subprocess
4import pytest
7@pytest.fixture(scope="session")
8def bin_path(tmp_path_factory: pytest.TempPathFactory) -> str:
9 """
10 Compiles a new `get_live_text` binary, and returns a path to the binary.
11 """
12 p = tmp_path_factory.mktemp("bin") / "get_live_text"
13 p.parent.mkdir(exist_ok=True)
15 subprocess.check_call(
16 ["swiftc", os.path.abspath("get_live_text.swift")], cwd=p.parent
17 )
18 assert p.exists()
20 return str(p)