https://git.schokokeks.org/derivepassphrase.git/tree/bad75d455d6e170c20b0405ead16fa732de727e3 Recent commits to derivepassphrase.git (bad75d455d6e170c20b0405ead16fa732de727e3) 2026-06-20T11:36:36+02:00 tag:gitlist.org,2012:commit/bad75d455d6e170c20b0405ead16fa732de727e3 Reformat recent test changes for consistent style 2026-06-20T11:36:36+02:00 Marco Ricci software@the13thletter.info <pre>&lt;/pre&gt; tag:gitlist.org,2012:commit/f797d5074181fc4d5a35f04367784543249315e4 Type generators explicitly as generators, not iterators 2026-06-19T22:40:11+02:00 Marco Ricci software@the13thletter.info <pre>For compatibility with `contextlib.contextmanager`, and because it is the more specific type, we annotate generators as `Generator[T, None, None]`, not as `Iterator[T]`. In January 2026, typeshed started shipping type annotations for the Python standard library that deprecate the use of `contextlib.contextmanager` with general functions returning `Iterator[T]`. `contextlib.contextmanager` actually requires a `Generator[T, None, None]` to work, but the `contextlib` and the `typing` documentation has been erroneously suggesting the `Iterator[T]` type as a "shorthand" notation for years. For `contextlib.contextmanager`, the difference matters. So, re-annotate everything explicitly with generators (when producing) or iterables (when consuming), whichever is appropriate. &lt;/pre&gt; tag:gitlist.org,2012:commit/3a69028fe108068a7c7ba6e0cdeeefc18df56e7d Refactor the (SSH agent) testing machinery tests for modularity 2026-06-19T21:31:13+02:00 Marco Ricci software@the13thletter.info <pre>Use pytest parametrization and hypothesis randomization systematically: tests that have exhaustive configurations or error conditions use pytest parametrization, tests with whole classes of configurations or error conditions use hypothesis randomization. Consolidate tests that test the same thing, but under different circumstances, into pytest parametrized tests. Also, use class inheritance to share helper functions for setting up the stub agent environment across all relevant test groups. Consolidating tests usually involves variants of a test for different variants of the stubbed agent. Converting pytest parametrization to a hypothesis strategy usually means settling for a `strategies.sampled_from(existing_parameter_set)` implementation and leaving any smarter generation logic to future edits. &lt;/pre&gt; tag:gitlist.org,2012:commit/27f35e7c4101164e42e08051b0698a55735f8322 Re-align the stubbed SSH agent socket with "real world" behavior 2026-06-18T06:15:10+02:00 Marco Ricci software@the13thletter.info <pre>Let the stubbed SSH agent tolerate incomplete request messages, or multiple request messages at once, within the same `sendall` call. Furthermore, change the error type to OSError (EBADF) for I/O on closed socket connections (mirroring the behavior of UNIX domain sockets) and when closing the connection, assert that no incomplete requests have been issued to the agent. With this change, the stubbed SSH agent socket now usefully models the communication channel between agent and client, and can be sensibly used to simulate communication and protocol errors (or their absence). This differentiates it—in terms of scope and use cases—from the agent protocol response queue, which monkeypatches the client instead of faking a server, and which operates on full request/response messages. Add some commentary to the stubbed SSH agent socket docstring to this effect. &lt;/pre&gt; tag:gitlist.org,2012:commit/729c89799dc49635698c8f73a59ba79eb3c584a0 Serialize the SSH agent protocol numbers as request/response codes 2026-06-16T22:19:26+02:00 Marco Ricci software@the13thletter.info <pre>When calling `bytes` on the SSH agent protocol number enums, return their corresponding serialization as request codes or response codes. (A follow-up to 57e3b1ed832e865e9f9e8316f930b1beae3714f0.) &lt;/pre&gt; tag:gitlist.org,2012:commit/3790413fb35878eb8500e29e7c6923104869d854 Rewrite test data initializers for nicer API docs 2026-06-16T19:55:01+02:00 Marco Ricci software@the13thletter.info <pre>In attribute declarations, `griffe`/`mkdocstring-python` elides the object on which the outermost method is called (but correctly autolinks the method itself). This looks good if the initializer is something like `base64.b64_decode(data)` (which gets shortened to `b64_decode(data)`), and terrible if the initializer is something like `base64.b64_decode(data).decode()` (which gets shortened to `decode()`). So, to get nicer API docs, rewrite some obvious cases where the object would otherwise be elided in the "class-bound method + self argument" style instead. &lt;/pre&gt; tag:gitlist.org,2012:commit/c2efe74d47243d97f87240eee0045cbb58abff53 Note that "spawning" an SSH agent in the tests may actually be "interfacing" 2026-06-16T19:47:25+02:00 Marco Ricci software@the13thletter.info <pre>&lt;/pre&gt; tag:gitlist.org,2012:commit/090f87b133247b5f688f5101f0229829616b22dd Use the BuiltinSSHAgentSocketProvider type in the tests 2026-06-15T22:27:21+02:00 Marco Ricci software@the13thletter.info <pre>Again, instead of magic strings floating around in the test suite, use the already existing enum instead. &lt;/pre&gt; tag:gitlist.org,2012:commit/7bccff34588cfb6ac90bc0d277a40cab5b9a5cf2 Use an enum for SSH agent configurations in the test suite 2026-06-15T21:36:53+02:00 Marco Ricci software@the13thletter.info <pre>Instead of having all these magic strings floating around all over the test suite, use a dedicated enum for consistency, discoverability, and typo-resistance. &lt;/pre&gt; tag:gitlist.org,2012:commit/b18d27971117d16358ddd511d69a11813464671e Auto-format everything due to tooling update 2026-06-15T18:20:15+02:00 Marco Ricci software@the13thletter.info <pre>&lt;/pre&gt;