neithere / argh

An argparse wrapper that doesn't make you say "argh" each time you deal with it.
http://argh.rtfd.org
GNU Lesser General Public License v3.0
369 stars 55 forks source link

Revamp unit tests #182

Open neithere opened 1 year ago

neithere commented 1 year ago

Purpose

Make the future deep rearrangement of the code safe and easy.

Context

The increasingly common typing hints (#107) are changing the scope of Argh and making many things easier. Now it makes sense to rely on type hints and make type guessing (from defaults, choices, etc.) secondary or even optional/deprecated. This calls for a serious restructuring of the code. We'll want to test the following transformations separately:

  1. building arg definitions from function signature (including type hints);
  2. augmenting signature-derived argh definitions from the @arg decorator;
  3. augmenting these further by guessing types from defaults/options when hints or explicit type aren't present;
  4. processing return value, potentially according to typing hints (probably going through a deprecation cycle with the current solution + adding some hooks for custom handlers);
  5. assembling multiple commands into parser(s).

Acceptance criteria

Scope

In scope:

Out of scope: