Repository navigation
test: run doctests in CI, skip network-bound examples - #188
Merged
Merged
Conversation
beaufour
force-pushed
the
test/doctest-hygiene
branch
from
October 27, 2026 12:53
e6c7e3c to
f47350f
Compare
- Enable --doctest-modules over testpaths [test, flickr_api]; the only offline doctest (SimpleCache) now runs in CI (325 tests). - Skip the flickr_api.auth module docstring and objects.Walker examples in conftest.py: both require a live Flickr API connection. - reflection.bindings_to: its example claimed an output that is not reproducible; converted to a plain (non-doctest) code block.
beaufour
force-pushed
the
test/doctest-hygiene
branch
from
October 27, 2026 13:10
f47350f to
786655e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docstring examples were never executed. This PR turns them on where they can actually run, and is explicit about where they can't:
pyproject.toml:testpaths = ["test", "flickr_api"]+addopts = "--doctest-modules"— the one offline doctest (SimpleCache) now runs as part of the suite.conftest.py: skipsflickr_api.auth's module docstring andflickr_api.objects.Walker's examples with a documented reason — both perform live Flickr API calls and cannot run in CI. (Stdlibdoctest/pytest do not honor the NumPy-style__doctest_skip__convention, hence the conftest hook.)flickr_api/reflection.pybindings_to: the existing doctest asserted output that wasn't reproducible (got[]), so it's converted to a plain code block rather than being enforced as a test with fake data.Local (rebuilt off fresh master at the exact head SHA): 292 passed, 2 skipped (the 2 skipped are the network-bound doctests), lint/mypy clean.
Test Plan
uv run pytestlocallyruff check,ruff format --check,mypycleanAutomated prep by Hermes maintainer.