diff --git a/pyproject.toml b/pyproject.toml index d8ac023f..8b8bfd95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ dependencies = [ ] [project.optional-dependencies] +dev = ["pytest", "pexpect"] acp = [ "agent-client-protocol>=0.8,<1", ] diff --git a/tests/test_tui_e2e.py b/tests/test_tui_e2e.py index 443defcc..eaa82441 100644 --- a/tests/test_tui_e2e.py +++ b/tests/test_tui_e2e.py @@ -15,9 +15,14 @@ from pathlib import Path from typing import Any, Callable -import pexpect import pytest +# Imported lazily: pexpect is only needed by these TUI end-to-end tests. +# A module-level `import pexpect` runs before the skipif mark below, so on an +# install without it pytest aborts collection of the whole suite instead of +# skipping this one file. +pexpect = pytest.importorskip("pexpect") + ROOT = Path(__file__).resolve().parents[1] pytestmark = pytest.mark.skipif(shutil.which("script") is None, reason="`script` is required for TUI e2e tests")