Skip to content

docs: broken code blocks in docs/source/async.rst; add Manuel tests for them#662

Merged
tobixen merged 1 commit intomasterfrom
issue661
Apr 17, 2026
Merged

docs: broken code blocks in docs/source/async.rst; add Manuel tests for them#662
tobixen merged 1 commit intomasterfrom
issue661

Conversation

@tobixen
Copy link
Copy Markdown
Member

@tobixen tobixen commented Apr 16, 2026

Fix for #661, with proper isolation from other outstanding work

…or them

The three runnable code blocks in docs/source/async.rst were broken:

1. `async with aio.get_async_davclient() as client:` fails with
   "coroutine object does not support the asynchronous context manager
   protocol" because get_async_davclient is an async function and must
   be awaited before it can be used as a context manager.  Fixed to
   `async with await aio.get_async_davclient() as client:`.
   Same bug was present in the Quick Start, the "Working with Calendars",
   and the "Parallel Operations" examples, and in the Migration section.

2. `cal.name` triggers a DeprecationWarning (use get_display_name()
   instead); replaced with `await cal.get_display_name()` in the two
   code blocks that used it.

The three runnable code blocks are now covered by the existing Manuel-
based test harness: added `test_async_ref = manueltest(...)` to
tests/test_docs.py (also fixed the double-assignment bug that made
test_async_tutorial silently shadow test_tutorial).  Confirmed tests
fail before fix and pass after.

Fixes: #661

prompt: Why is the "quick start" in docs/source/async.rst failing?
followup-prompt: We need the code blocks in the documentation to be exercised by test code whenever possible. We already have some tests covering the tutorial. See if it's possible to get the code blocks that was changed just now tested. Revert the docfixes to verify that the tests are working correctly. Docfixes plus tests should be in the same commit, and remember to add prompts to the commit message.
followup-prompt: Add a reference to #661 in the commit message
@tobixen tobixen merged commit f76d107 into master Apr 17, 2026
9 checks passed
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.

1 participant