https://git.schokokeks.org/derivepassphrase.git/tree/b76c2afc68fd4e0a5164fa9ff258470be947d5e2Recent commits to derivepassphrase.git (b76c2afc68fd4e0a5164fa9ff258470be947d5e2)2026-06-20T13:58:03+02:00tag:gitlist.org,2012:commit/b76c2afc68fd4e0a5164fa9ff258470be947d5e2Harmonize tests for missing SSH agent communication support2026-06-20T13:58:03+02:00Marco Riccisoftware@the13thletter.info
<pre>Use a common parameter set and a common monkeypatching setup. At the
moment, this is done by copy-pasting the parametrization and setup code,
but this could feasibly be abstracted into a common testing function and
common parameter set within the `tests.data` and `tests.data.callables`
modules.
</pre>
tag:gitlist.org,2012:commit/bad75d455d6e170c20b0405ead16fa732de727e3Reformat recent test changes for consistent style2026-06-20T11:36:36+02:00Marco Riccisoftware@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/f797d5074181fc4d5a35f04367784543249315e4Type generators explicitly as generators, not iterators2026-06-19T22:40:11+02:00Marco Riccisoftware@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.
</pre>
tag:gitlist.org,2012:commit/3a69028fe108068a7c7ba6e0cdeeefc18df56e7dRefactor the (SSH agent) testing machinery tests for modularity2026-06-19T21:31:13+02:00Marco Riccisoftware@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.
</pre>
tag:gitlist.org,2012:commit/27f35e7c4101164e42e08051b0698a55735f8322Re-align the stubbed SSH agent socket with "real world" behavior2026-06-18T06:15:10+02:00Marco Riccisoftware@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.
</pre>
tag:gitlist.org,2012:commit/729c89799dc49635698c8f73a59ba79eb3c584a0Serialize the SSH agent protocol numbers as request/response codes2026-06-16T22:19:26+02:00Marco Riccisoftware@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.)
</pre>
tag:gitlist.org,2012:commit/3790413fb35878eb8500e29e7c6923104869d854Rewrite test data initializers for nicer API docs2026-06-16T19:55:01+02:00Marco Riccisoftware@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.
</pre>
tag:gitlist.org,2012:commit/c2efe74d47243d97f87240eee0045cbb58abff53Note that "spawning" an SSH agent in the tests may actually be "interfacing"2026-06-16T19:47:25+02:00Marco Riccisoftware@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/090f87b133247b5f688f5101f0229829616b22ddUse the BuiltinSSHAgentSocketProvider type in the tests2026-06-15T22:27:21+02:00Marco Riccisoftware@the13thletter.info
<pre>Again, instead of magic strings floating around in the test suite, use
the already existing enum instead.
</pre>
tag:gitlist.org,2012:commit/7bccff34588cfb6ac90bc0d277a40cab5b9a5cf2Use an enum for SSH agent configurations in the test suite2026-06-15T21:36:53+02:00Marco Riccisoftware@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.
</pre>