Skip to content

Run the fork's tests in CI, and make them pass - #10

Merged
parawanderer merged 3 commits into
mainfrom
fix/tests-run-in-ci
Nov 21, 2026
Merged

parawanderer merged 3 commits into
mainfrom
fix/tests-run-in-ci

Conversation

@parawanderer

Copy link
Copy Markdown
Owner

The fork's workflows had never run: Actions starts disabled on a fork, so no PR or push here was ever tested. "Run unit tests" and "Pre-commit" are now enabled; "Upload Python Package" and "Deploy documentation" (upstream's PyPI and docs releases) are disabled. The first run on main failed 8 of 885 tests on 3.10 (fail-fast cancelled the other versions) and about 85 basedpyright errors in pre-commit. This PR fixes those.

  • findmy/util/http.py: catch asyncio.TimeoutError as well as TimeoutError. They are the same class only from 3.11, so on 3.10 a timed-out request was never described. A library bug, not a test bug.
  • tests/: import test_device_identity as a sibling module (tests is not a package under uv run pytest). Compare the TLS context with a default context, because on Linux the platform store is a directory that get_ca_certs() does not list.
  • pyproject.toml: force-exclude = true. pre-commit passes file names, and ruff lints a named file even when exclude lists it.
  • ruff format over ten library files that had drifted (formatting only). The curl reproduction in account.py is rewritten in prose, since ruff flags it as commented-out code. Lint fixes and noqas in examples/sweep_keychain_for_bytes.py.
  • Test typing: @override on the fake providers, .get() for NotRequired keys, a None check, a return type. Files whose doubles stand in for real classes turn off reportArgumentType and reportAttributeAccessIssue at the top, with the reason.

Local: 885 pass on 3.10 and 3.14 (macOS) and 3.10 (Linux, Docker); ruff check, ruff format --check and basedpyright clean over every tracked file. This is also the first PR since the workflows were enabled, so its checks show whether pull_request triggers them.

Drafted by Claude Code

🤖 Generated with Claude Code

parawanderer and others added 3 commits November 21, 2026 12:17
aiohttp raises asyncio.TimeoutError, which is the builtin TimeoutError only from 3.11. On
3.10 the handler never matched, so a request that outran the clock arrived as the bare
exception this was written to replace. Found by the fork's tests, the first time they ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fork's workflows had never run (Actions starts disabled on a fork), so these only ever
ran locally:

- Import test_device_identity as a sibling module, like the other helpers. `tests` is not a
  package and is not on the path under `uv run pytest`.
- Compare the TLS context with a default one instead of counting anchors. Where the platform
  store is a directory, OpenSSL reads it lazily and get_ca_certs() lists none of it, so a
  correct context counted 1 on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- force-exclude, so ruff honours `exclude = ["tests/", ...]` for the file names pre-commit
  passes; without it every staged test file was linted.
- ruff format over the ten library files that had drifted. Formatting only.
- account.py: the curl reproduction in a comment read as commented-out code; the same in prose.
- examples/sweep_keychain_for_bytes.py: contextlib.suppress for the base64 probe, and noqa for
  the untyped account and peer and the inspector's size.
- Tests, for basedpyright: @OverRide on the fake Anisette providers, .get() for NotRequired
  keys, a None check on the SRP session key, the DerElement return type, and PinnedRoots.load
  named directly. The files whose doubles stand in for real classes turn off
  reportArgumentType and reportAttributeAccessIssue, with the reason, instead of a cast at
  every injection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@parawanderer parawanderer reopened this Nov 21, 2026
@parawanderer
parawanderer merged commit 87ece12 into main Nov 21, 2026
16 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