From aacbf8462ac5c2390ae46be4000b4c6d55092de3 Mon Sep 17 00:00:00 2001 From: Kazuya Takei Date: Wed, 20 Mar 2024 17:54:12 +0900 Subject: [PATCH] ci: Run 'cargo build' before run pytest --- tests/conftest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 4ba860b..130d0fd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,14 +1,23 @@ """Common test contexts.""" from pathlib import Path +from subprocess import PIPE, run import pytest +project_root = Path(__file__).parent.parent + + +@pytest.fixture(scope="session", autouse=True) +def build_test_target(): + """Generate age binary for testing.""" + run(["cargo", "build"], stdout=PIPE, stderr=PIPE, cwd=project_root) + @pytest.fixture def root() -> Path: """Path-object of project root.""" - return Path(__file__).parent.parent + return project_root @pytest.fixture