https://git.schokokeks.org/derivepassphrase.git/tree/d4ff1362953e1acdf74dfa1b9529bb97df552604 Recent commits to derivepassphrase.git (d4ff1362953e1acdf74dfa1b9529bb97df552604) 2025-08-14T20:58:10+02:00 tag:gitlist.org,2012:commit/d4ff1362953e1acdf74dfa1b9529bb97df552604 Rearrange tests as per the new groupings 2025-08-14T20:58:10+02:00 Marco Ricci software@the13thletter.info <pre>Also resolve some TODOs, usually by removing duplicate or quasi-duplicate tests. &lt;/pre&gt; tag:gitlist.org,2012:commit/b2fb0785d0d6b62077171e797424b2f30db4760c Also regroup the vault tests into smaller groups 2025-08-14T19:10:17+02:00 Marco Ricci software@the13thletter.info <pre>As in a2c0a0b3b6f000d824787dabc011041549bda206, introduce further classes/groupings for the `vault` derivation scheme tests, trimming test names appropriately. &lt;/pre&gt; tag:gitlist.org,2012:commit/79e5c37b8eac357c6b5afb6fdcd5e70c0ee3dd43 Regroup the CLI and SSH agent tests into smaller groups 2025-08-11T21:50:42+02:00 Marco Ricci software@the13thletter.info <pre>Beyond the five main groups that reflect the original five test classes for the command-line interface, introduce further classes/groupings for related tests, and trim the test names appropriately. In particular, remove the ordinal in the test name until the new order (due to the new class names and trimmed test names) sufficiently settles. Do the same for the SSH agent tests. (This could have been done for all tests, but with diminishing returns.) The grouping currently (mostly) reflects thematic similarity, but in the long run, we intend for it to reflect both thematic similarity and common test environments, with respect to setup and teardown: tests of the same group should look similar to each other too, and common code among tests of the same group should be factored out if possible. The grouping is inserted, syntactically, between the existing test functions. In particular, to keep the diff readable, we do not relocate or reorder any test functions yet in this commit. We add some TODOs to indicate where further reordering or rewriting is necessary, beyond just introducing new groups. The intended (but not yet implemented) sharing of test setup and teardown code will probably entail using fixtures, pytest's preferred mechanism for shared setup and teardown. However, as of this writing, it is still an open question how to deal with `hypothesis`-based tests in this scenario: they do not work well together with per-function test fixtures, but we also do *not* want to have to (re-)implement all setup/teardown pairs once as a fixture and once as a context manager. &lt;/pre&gt; tag:gitlist.org,2012:commit/b5da8fcc777a208d6763a37524e08402e47cf79a Remove outdated test for CLI program name and version number 2025-08-09T19:04:38+02:00 Marco Ricci software@the13thletter.info <pre>The more exhaustive `--version` output parsing tests already assert that the program name and version number match their expected values. There is no point in separately testing this. &lt;/pre&gt; tag:gitlist.org,2012:commit/f3bcf5b55a4aa19b733a1d1fa9562ff201f06adf Ensure that `pytest` picks up the newly-split test modules again 2025-08-09T18:49:50+02:00 Marco Ricci software@the13thletter.info <pre>If a test module is merely converted to a package, then `pytest` will no longer pick it up, because the name `__init__.py` does not match the test module name pattern anymore. So, rename them. Also set the `pytest` import mode to `importlib`, as per the documentation's suggestion. I haven't had any trouble with this *yet*, but now I have similarly named modules, so this might otherwise crop up in the future. &lt;/pre&gt; tag:gitlist.org,2012:commit/9ad57b1f6bde28fb9da3f0a3bd2fd4188455dd2a Split the CLI tests into one file per class/group 2025-08-09T16:22:42+02:00 Marco Ricci software@the13thletter.info <pre>The CLI tests, already loosely grouped through the use of classes, are now distributed to different files, one file per test class. This is mostly an attempt to keep the file size managable. Navigating in a multi-thousand-line Python file with very similar looking tests gets disorienting very quickly. &lt;/pre&gt; tag:gitlist.org,2012:commit/d4cd8ce103374859a324c50deab8954a08c4626d Format and lint all test files 2025-08-09T15:19:17+02:00 Marco Ricci software@the13thletter.info <pre>&lt;/pre&gt; tag:gitlist.org,2012:commit/a5135873c0ebd313b0272b449b620a10115511f3 Use leaf module imports in all test modules 2025-08-09T15:12:40+02:00 Marco Ricci software@the13thletter.info <pre>Instead of importing submodules and navigating to them via the top-level module (`import spam.ham.eggs`), use leaf module imports (`from spam.ham import eggs`). Though there is sometimes the need to rename the imported module, doing so leads to shorter expressions in general. It also allows static analysis tools to accurately detect whether a module is in use or not. (Such a detection is much more murky if the whole module path needs to be traversed each time.) &lt;/pre&gt; tag:gitlist.org,2012:commit/493fe930240feade37cec6aef097a9740cea550e Split off "heavy duty" tests from the respective test file 2025-08-09T14:44:43+02:00 Marco Ricci software@the13thletter.info <pre>Split off the slow, `hypothesis`-based integration tests (the "heavy duty" tests) from the `test_derivepassphrase_cli`, `test_derivepassphrase_ssh_agent` and `test_derivepassphrase_types` modules into separate submodules named `heavy_duty`. Additionally, mark the contents of these `heavy_duty` submodules with the `heavy_duty` `pytest` mark. We do this both because the integration tests are slow and because they are relatively large per test: you typically write a whole new class plus support code per test, plus you reexport one of the class's attributes as a top-level, auto-discoverable test. Though specifically marked, the tests are still run by default. &lt;/pre&gt; tag:gitlist.org,2012:commit/4b8ef3e200e3de1167e073c9163be34cd77205fa Turn the `vault` test config functions into methods 2025-08-08T23:09:22+02:00 Marco Ricci software@the13thletter.info <pre>Turn the `is_valid_test_config`, `is_smudgable_vault_test_config` and `_test_config_ids` functions into methods of the `VaultTestConfig` class: `is_valid`, `is_smudgable` and `_test_id`. This fits the overall intent of only providing types and some simple predicates or transformations, and it reads much nicer if a short method name is used instead of an explicit function name. (And if a one-argument function is required, it can be obtained, as a bound method, from the class.) &lt;/pre&gt;