Skip to content

Commit 9206abd

Browse files
committed
docs: add docs pages to pytest-examples and fix code examples
- Add docs/quickstart.md and docs/concepts.md to pytest-examples so all code blocks in documentation are linted by ruff - Fix f-string in concepts.md Prompts example that contained backticks causing a syntax error when parsed standalone
1 parent f4e0918 commit 9206abd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Prompts are reusable templates for LLM interactions. They help standardize commo
7070
@mcp.prompt()
7171
def review_code(code: str, language: str = "python") -> str:
7272
"""Generate a code review prompt."""
73-
return f"Review this {language} code:\n\n```{language}\n{code}\n```"
73+
return f"Please review the following {language} code:\n\n{code}"
7474
```
7575

7676
<!-- TODO: See [Prompts](server/prompts.md) for full documentation. -->

tests/test_examples.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ async def test_desktop(monkeypatch: pytest.MonkeyPatch):
9797

9898

9999
# TODO(v2): Change back to README.md when v2 is released
100-
@pytest.mark.parametrize("example", find_examples("README.v2.md"), ids=str)
100+
@pytest.mark.parametrize(
101+
"example",
102+
find_examples("README.v2.md", "docs/quickstart.md", "docs/concepts.md"),
103+
ids=str,
104+
)
101105
def test_docs_examples(example: CodeExample, eval_example: EvalExample):
102106
ruff_ignore: list[str] = ["F841", "I001", "F821"] # F821: undefined names (snippets lack imports)
103107

0 commit comments

Comments
 (0)