close
Skip to content

Add detail/examples to "How to write unit tests" doc #2147

@dwilding

Description

@dwilding

Based on feedback internally, we should cover a couple more things in How to write unit tests for a charm:

  • What might a test look like for a machine charm? The doc already has an example of how to verify that config was written in a container. We could add a similar example for a machine charm, mocking pathops/pathlib functions as needed.

  • Mention how to run unit tests. The doc doesn't mention tox -e unit anywhere. Even though the doc is about writing tests, people expect to find out how to run tests too. How to write integration tests for a charm has a section called "Run your tests", which I think is good.

Metadata

Metadata

Assignees

Labels

26.04An item we hope to do in the 26.04 cycledocsImprovements or additions to documentationrainy daySmall items done in ~10% of each week's time

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions