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.
https://docs.python.org/3/library/doctest.html
Kind of useful to ensure that our examples stay up to date as code changes. But also, very slow to run, since our examples re-initialize resources ever time (which I'd prefer to keep, it makes examples self-sufficient, w/o having to scroll up to see how objects were created). The old default
setup.cfg
file that we inherited from Alex included running module doctests as part of the defaultpytest
args but I think that's an unnecessary practice given this -- main tests are for checking for regressions and ensuring functions, and you should only run doctests once an issue is ~complete to ensure that examples stay current.async
support kinda sucks. It presumes a basic Python REPL context, which means you can'tawait
anything outside of a function. Worse, using multipleasync.run
calls in a single docstring causes some sort of problem (either unfixable w/r/t doctests themselves, or something about how we're usingasyncpg
), so I'm currently not sure how to show multiple discrete examples forasync
functions.