From 4faf5fc933eb90b15411358c537e5f7007489391 Mon Sep 17 00:00:00 2001 From: Alpamys Date: Fri, 24 Apr 2026 23:47:19 +0500 Subject: [PATCH] test(inference): skip 3 CLI tests when FastAPI is absent The ubuntu-latest py3.11 matrix cell doesn't install the [serve] extra, so `soup serve` exits early with a FastAPI-missing message before reaching --structured-output / --auto-quant / --json-schema validation. Add `pytest.importorskip("fastapi")` to the three tests that exercise those CLI-level validation paths. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/test_inference_advanced.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_inference_advanced.py b/tests/test_inference_advanced.py index 40f8046..7bfb570 100644 --- a/tests/test_inference_advanced.py +++ b/tests/test_inference_advanced.py @@ -816,6 +816,7 @@ class TestTracingExtra: class TestStructuredOutputExtra: def test_cli_json_without_schema_errors(self, tmp_path): """--structured-output json must require --json-schema.""" + pytest.importorskip("fastapi") # CLI exits early w/o FastAPI from typer.testing import CliRunner from soup_cli.cli import app @@ -843,6 +844,7 @@ class TestStructuredOutputExtra: class TestAutoQuantCLIWarning: def test_auto_quant_prints_deferral_warning(self, tmp_path): """--auto-quant must print a yellow warning explaining it's a no-op.""" + pytest.importorskip("fastapi") # CLI exits early w/o FastAPI from typer.testing import CliRunner from soup_cli.cli import app @@ -871,6 +873,7 @@ class TestAutoQuantCLIWarning: class TestJsonSchemaContainment: def test_json_schema_outside_cwd_rejected(self, tmp_path, monkeypatch): """JSON schema path must stay under cwd.""" + pytest.importorskip("fastapi") # CLI exits early w/o FastAPI from typer.testing import CliRunner from soup_cli.cli import app