Skip to content

docs: Add examples to docstrings#30

Merged
msto merged 1 commit intomainfrom
ms/doc-examples
Mar 13, 2026
Merged

docs: Add examples to docstrings#30
msto merged 1 commit intomainfrom
ms/doc-examples

Conversation

@msto
Copy link
Copy Markdown
Collaborator

@msto msto commented Mar 7, 2026

Add usage examples to docstrings for _typing_extensions helper functions, CounterPivotTable, DelimitedList, Metric.read(), Metric._header_fieldnames(), and MetricWriter.

@msto msto assigned clintval and msto and unassigned clintval and msto Mar 7, 2026
Copy link
Copy Markdown
Member

@clintval clintval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add pytest-doctestplus to the dev dependencies.

Then have something like:

[tool.pytest.ini_options]
minversion = "7.4"
addopts    = [
    "--color=yes",
    "--cov-fail-under=80",
    "--cov-report=term-missing",
    "--cov",
    "--cov=typeline",
    "--doctest-modules",
    "--doctest-plus",
    "--import-mode=importlib",
]
doctest_plus = "enabled"
doctest_optionflags = [
    "ELLIPSIS",
    "IGNORE_EXCEPTION_DETAIL",
    "NORMALIZE_WHITESPACE",
]

You can get auto-testing of these examples.

If you have any Python in Markdown, you can test too with:

[tool.poe.tasks]
check-tests = "pytest --doctest-glob='*.md'"

@clintval clintval assigned msto and unassigned clintval Mar 9, 2026
Add usage examples to docstrings for `_typing_extensions` helper
functions, `CounterPivotTable`, `DelimitedList`, `Metric.read()`,
`Metric._header_fieldnames()`, and `MetricWriter`.

Co-Authored-By: Rahul Kaushal <kaushalrahul15@gmail.com>
@msto msto force-pushed the ms/doc-examples branch from f72f8a0 to 05f0a78 Compare March 13, 2026 18:11
@msto msto merged commit 73c04a3 into main Mar 13, 2026
2 checks passed
@msto msto deleted the ms/doc-examples branch March 13, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants