{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/7"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/4"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"Xdoctest finds and executes test code embedded in Python docstrings, replacing the built-in doctest module with an AST-based parser that integrates with pytest or runs standalone.","skillfed_tags":["doctest","pytest-plugin","documentation-testing"],"use_cases":["Validate example code in function and class docstrings during development or CI to catch documentation drift","Write minimal working examples in docstrings that serve as both documentation and regression tests","Run all doctests in a project with a single command to ensure examples remain executable","Integrate doctest execution into pytest workflows alongside unit tests for comprehensive test coverage","Debug functions by first writing example inputs and outputs in docstrings, then implementing the body"],"what_it_does":"Xdoctest is a replacement for Python's built-in doctest module that discovers and executes example code written in docstrings. Instead of using regex-based parsing, it employs an abstract-syntax-tree parser for more reliable detection and execution of doctests. The package encourages writing tests and documentation together in the same file, reducing boilerplate and helping developers maintain minimal working examples alongside their code.\n\nYou can run xdoctest either as a standalone command-line tool or as a pytest plugin. The standalone interface lets you execute all doctests in a module, list them, dump them as unit tests, or run specific functions' doctests. The pytest integration allows you to run doctests alongside your regular unit tests using a single command, making it practical for CI pipelines. The package is actively maintained, supports Python 3.8 through 3.14, and has no external runtime dependencies.","worth_installing":"Yes. Xdoctest is a mature, actively maintained tool with zero dependencies and broad Python support. It solves a real problem\u2014keeping documentation examples in sync with code\u2014and integrates cleanly into both standalone and pytest workflows. The permissive Apache 2 license poses no restriction. Install it if you want to treat docstring examples as executable tests."},"id":"xdoctest","links":{"html":"https://skillfed.io/packages/xdoctest","md":"https://skillfed.io/packages/xdoctest.md","pypi":"https://pypi.org/project/xdoctest/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-27","license_spdx":null,"license_treatment":"permissive","name":"xdoctest","python_support":"supports_current","summary":"A rewrite of the builtin doctest module"},"popularity":{"monthly_downloads":1091491,"position":4379,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.3.2"}
