Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test the code in the README #139

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

tonyandrewmeyer
Copy link
Collaborator

Adds a tox environment test-readme (not run by default) that tests (most of) the code blocks in README.md.

Also some corresponding changes to the README:

  • Remove all the import ops and import scenario lines - these seem like noise and are implied I think.
  • Remove "from charm import Charm" type lines and "class MyCharm(...): ..." lines - these also seem like noise, although they are a little bit less implied. I could add a "here is the code that's used throughout the doc" section at the top if that would be better.
  • Flesh out a couple of examples a small amount so that the various asserts work.
  • Fix a few bugs that had crept in (the kind of ones that running this tox command would catch).

Copy link
Collaborator

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: pytest-markdown. Fun stuff!

@tonyandrewmeyer tonyandrewmeyer merged commit dcab8d0 into canonical:7.0 Jun 6, 2024
2 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the test-md-code branch June 6, 2024 05:57
@benhoyt
Copy link
Collaborator

benhoyt commented Jun 6, 2024

Nice idea, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants