Fix and improve tests#686
Merged
Merged
Conversation
Member
|
Thanks, I will look through it. |
tobixen
requested changes
Jun 14, 2026
XandikosServer.stop() scheduled a coroutine via run_coroutine_threadsafe that awaited the aiohttp runner cleanup and then called loop.stop() from *inside* that same coroutine. Stopping the loop from within the coroutine prevents the loop from delivering the coroutine's result back to the concurrent.futures.Future, so .result(timeout=10) never resolved and blocked for the full 10 seconds. Because the embedded server is started and stopped once per test, this added ~10s to every Xandikos test teardown, making the integration suite take many minutes and appear to hang. Measured stop() dropped from 10.018s to 0.009s. Fix: await only the runner cleanup inside the coroutine, then stop the loop from outside it via call_soon_threadsafe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test_server fixture in AsyncFunctionalTestsBaseClass was scope="class" but defined as a plain instance method. Recent pytest raises PytestRemovedIn10Warning for that pattern, and the project's filterwarnings = ["error"] turns it into a hard error -- erroring out all 122 async integration tests at fixture setup. The fixture only reads the class-level `server` attribute and starts/stops it, so there is no per-instance state to lose. Make it a @classmethod as the warning recommends. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
read_config only caught FileNotFoundError when probing the optional config
file locations. When HOME is unset (e.g. a Nix build sandbox), the default
path expands to '//.config//caldav/calendar.conf', which open() rejects with
IsADirectoryError. That OSError propagated out of an optional-config probe,
breaking get_davclient() and even crashing pytest's terminal summary renderer.
Catch OSError (covers not-found, is-a-directory, and permission errors) and
treat any of them as 'no config here', returning {} as before.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fe38acf to
4caf646
Compare
Member
|
There will be a new release of the caldav library soon ... though, I cannot promise how soon (I have a ton of commits done by Claude, I need to go through and review all of them manually, fix up changelog and commit messages, run all the tests, write some release notes ... and the rest of the month I'm super-busy with other things). |
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.
hi there.
i ran into your repository while trying to fix some builds for nixpkgs on macos.
i ran into three problems:
i hope this changes are welcome.
speed improvements
last successful job in this repo: https://github.com/python-caldav/caldav/actions/runs/27359451891/job/80842588388
with this branch locally: