{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"A pytest plugin that executes Python code snippets embedded in markdown files and docstrings as automated tests, detecting fenced code blocks and inline examples.","skillfed_tags":["documentation-testing","pytest-plugin","example-validation"],"use_cases":["Validate code examples in README files and API documentation to prevent outdated or broken examples.","Test docstring examples in library code without duplicating assertions in separate test files.","Ensure tutorial markdown files contain working, up-to-date code snippets that readers can trust.","Catch regressions in documented usage patterns when refactoring library APIs.","Generate living documentation where code examples are guaranteed to execute correctly."],"what_it_does":"pytest-markdown-docs is a pytest plugin that treats Python code blocks in markdown files and docstrings as executable test cases. It scans for fenced code blocks (triple backticks) marked with python, python3, or py language tags, and runs them through pytest's test framework. This bridges the gap between documentation and testing: code examples in your README, API docs, or docstrings can be automatically validated to ensure they remain correct as your codebase evolves.\n\nThe plugin supports several advanced features: skipping blocks with notest markers, injecting global variables or fixtures into code blocks, using pytest fixtures (including async fixtures from pytest-asyncio), chaining snippets with continuation markers to maintain state across blocks, and retrying flaky tests. It also handles MDX files with metadata comments and supports custom markdown-it-py parser configurations for compatibility with tools like Material for MkDocs.","worth_installing":"Yes. The plugin solves a real problem\u2014keeping documentation examples in sync with code\u2014with low friction and active maintenance. MIT licensing removes legal concerns. It integrates cleanly into existing pytest workflows via a command-line flag. Suitable for projects that prioritize documentation quality and want automated validation of code examples."},"id":"pytest-markdown-docs","links":{"html":"https://skillfed.io/packages/pytest-markdown-docs","md":"https://skillfed.io/packages/pytest-markdown-docs.md","pypi":"https://pypi.org/project/pytest-markdown-docs/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-23","license_spdx":"MIT","license_treatment":"permissive","name":"pytest-markdown-docs","python_support":"supports_current","summary":"Run markdown code fences through pytest"},"popularity":{"monthly_downloads":300279,"position":7843,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.9.2"}
