Repository navigation
Conversation
The package carried prose docstrings on every public symbol but zero runnable examples, so nothing verified that what they claim is still true — the failure mode where a docstring keeps rendering perfectly after the behaviour beneath it changes. 33 examples across `LinearSolver`, `SCS`, `SCS.solve`, `SCS.update` and the legacy `solve()`. Each is self-contained and deterministic: tight eps_abs/eps_rel, verbose=False, values rounded before printing. Also fills two gaps in the same file: `SCS` had no class docstring, and the public legacy `solve()` had only a `#` comment above it. `test/test_doctests.py` runs them against the installed package and asserts `attempted > 0` as well as `failed == 0`, so a module that silently loses its examples fails rather than passes. Closes bodono#240 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
Thanks for the work, but as noted on #240 we're not adding doctests to the docstrings or a doctest job to CI. Closing. |
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.
Closes #240
Every public symbol carried prose documentation but zero runnable examples, so nothing verified that what the docstrings claim is still true — the failure mode where a docstring keeps rendering perfectly long after the behaviour beneath it changed.
33 examples added:
LinearSolverSCS(new class docstring)SCS.solveSCS.updatesolve(legacy)Each is self-contained and deterministic — tight
eps_abs/eps_rel,verbose=False, values rounded before printing — so they run standalone rather than depending on an earlier example's state.This also fills two gaps in the same file:
SCShad no class docstring at all, and the public legacysolve()had only a#comment above it rather than a docstring.test/test_doctests.pyruns them against the installed package (what users import) and assertsattempted > 0as well asfailed == 0, so a module that silently loses its examples fails rather than passes. I negative-tested that guard: injecting a wrong expected value givesattempted: 31 failed: 1.The test takes
capsys, whichpytest-run-parallelauto-detects as thread-unsafe, so it serialises correctly under the free-threading job's--parallel-threads=4.Full suite after the change: 397 passed, 67 skipped.
🤖 Generated with Claude Code