From 58ed5f5d22b82c7e5d75964c159445ba02d68f0e Mon Sep 17 00:00:00 2001 From: daavoo Date: Mon, 29 Sep 2025 17:50:14 +0200 Subject: [PATCH] tests: Drop mocks in `test-docs`. Actually run the code snippets. --- .github/workflows/tests-docs.yaml | 5 ++++- tests/docs/test_all.py | 10 ++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests-docs.yaml b/.github/workflows/tests-docs.yaml index 956481d1..ef9aa831 100644 --- a/.github/workflows/tests-docs.yaml +++ b/.github/workflows/tests-docs.yaml @@ -35,9 +35,12 @@ jobs: - name: Install run: | - uv sync --group tests + uv sync --group tests --extra mistral - name: Run Documentation tests + env: + MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: pytest tests/docs -v --cov --cov-report=xml - name: Upload coverage reports to Codecov diff --git a/tests/docs/test_all.py b/tests/docs/test_all.py index 351cd647..5ef109a2 100644 --- a/tests/docs/test_all.py +++ b/tests/docs/test_all.py @@ -1,6 +1,4 @@ import pathlib -from typing import Any -from unittest.mock import patch import pytest from mktestdocs import check_md_file @@ -11,9 +9,5 @@ list(pathlib.Path("docs").glob("**/*.md")), ids=str, ) -def test_all_docs(doc_file: pathlib.Path, monkeypatch: Any) -> None: - monkeypatch.setenv("MISTRAL_API_KEY", "test_key") - with ( - patch("any_llm.any_llm.AnyLLM.create"), - ): - check_md_file(fpath=doc_file, memory=True) # type: ignore[no-untyped-call] +def test_all_docs(doc_file: pathlib.Path) -> None: + check_md_file(fpath=doc_file, memory=True) # type: ignore[no-untyped-call]