Skip to content

Reconsider the pytester based unit test approach in at least some cases #75

Description

@james-garner-canonical

In #67, we added support for Juju controller and model arguments, and added pytester based unit tests to exercise the CLI portion. There was some discussion about whether this was the right approach in the end. The key issue in this case is that whether the inner test passes or fails depends in a non-obvious way on exactly the right CLI args being passed.

Alternatives to what landed that we should consider:

  1. Make the inner tests aware of their arguments via config.getoption and set their expected values to assert on accordingly. Call the inner tests multiple times with different CLI arguments.
  2. Just mock request.config.getoption and have single layer tests in cases like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rainy daySmall items done in ~10% of each week's timetestsRelated to tests or testing

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions