From 08710fa2a5c193c2580d7a0e5acbb19696e6f393 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Fri, 9 Aug 2024 13:40:20 +0000 Subject: [PATCH] Run docs code blocks in markdown --- docs/how-to/write-a-formatter.md | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/how-to/write-a-formatter.md b/docs/how-to/write-a-formatter.md index 5384025c..5a9f0c08 100644 --- a/docs/how-to/write-a-formatter.md +++ b/docs/how-to/write-a-formatter.md @@ -96,7 +96,7 @@ pvi supports templates for edl, adl and bob files, which can be referenced from Inside of the format function, we need to provide a reference to the template file that can then be used to identify what each widget should look like. -```python3 +```python3 notest template = BobTemplate(str(Path(__file__).parent / "dls.bob")) ``` diff --git a/pyproject.toml b/pyproject.toml index 3077a4ad..f451179a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ dev = [ "pyright", "pytest", "pytest-cov", + "pytest-markdown-docs", "ruff", "sphinx-autobuild", "sphinx-copybutton", @@ -70,7 +71,7 @@ strict = ["src/**"] [tool.pytest.ini_options] # Run pytest with all our checkers, and don't spam us with massive tracebacks on error addopts = """ - --tb=native -vv --doctest-modules --doctest-glob="*.rst" + --tb=native -vv --doctest-modules --doctest-glob="*.md" --markdown-docs """ # https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings filterwarnings = "error"