{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"A pytest plugin that automatically discovers and runs Python and shell code blocks from README and markdown files as test cases.","skillfed_tags":["documentation-testing","markdown-validation"],"use_cases":["Verify that code examples in a project's README actually execute without errors.","Catch breaking changes when refactoring by running documented usage patterns as tests.","Validate shell command sequences and their output in installation or setup documentation.","Ensure multi-step code examples work when split across separate markdown blocks.","Skip or mark code blocks as expected-to-fail for examples that demonstrate error handling."],"what_it_does":"pytest-codeblocks is a pytest plugin that treats code blocks in markdown files\u2014particularly READMEs\u2014as executable test cases. It discovers blocks marked with python, sh, bash, or zsh syntax highlighting and runs them through pytest, letting you verify that documentation examples actually work.\n\nThe plugin supports marking code blocks with pytest directives (skip, skipif, xfail) via HTML comments, merging fragmented examples across multiple blocks, and validating expected output. This catches a common documentation debt: examples that drift out of sync with the actual codebase. It depends only on pytest and requires Python 3.10 or later.","worth_installing":"Yes. Low install friction, no security vulnerabilities, permissive MIT license, and active maintenance make this a straightforward addition to any project with documentation that includes runnable code. It solves a real problem\u2014keeping examples in sync with code\u2014with minimal overhead."},"id":"pytest-codeblocks","links":{"html":"https://skillfed.io/packages/pytest-codeblocks","md":"https://skillfed.io/packages/pytest-codeblocks.md","pypi":"https://pypi.org/project/pytest-codeblocks/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-15","license_spdx":null,"license_treatment":"permissive","name":"pytest-codeblocks","python_support":"supports_current","summary":"Test code blocks in your READMEs"},"popularity":{"monthly_downloads":186361,"position":9989,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.18.0"}
