Skip to content

Revamp unit tests #182

@neithere

Description

@neithere

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

  • only public methods are tested; tests for private methods, if still relevant, are moved to public ones.
  • add more coverage on higher level, with actual use cases

Scope

In scope:

  • rearranging existing unit tests;
  • possibly increasing top-level coverage of currently supported cases.

Out of scope:

  • rearranging the code itself;
  • writing unit tests for future layers/components.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions