-
Notifications
You must be signed in to change notification settings - Fork 10
Extend mktestdocs beyond python blocks #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c7fc0a5
fix black formattting
ucodery c271673
add executors
ucodery 6d7b3ba
add bash executor
ucodery 8b22f71
Update tests.yml
koaning f797d66
Update tests.yml
koaning 253cd05
Update tests.yml
koaning 5efba76
move big test data files
ucodery 860dd45
Expand README with new language feature
ucodery 752886c
Add explicit exceptions for missing lang
ucodery 5af9433
clean up test data files
ucodery 99a1e74
test mktestdocs own README
ucodery 867bd00
Correct and test json data
ucodery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| black: | ||
| black memo tests setup.py | ||
| black mktestdocs tests setup.py | ||
|
|
||
| test: | ||
| pytest | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from copy import copy | ||
|
|
||
| import pytest | ||
|
|
||
| import mktestdocs | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def temp_executors(): | ||
| old_executors = copy(mktestdocs.__main__._executors) | ||
| yield | ||
| mktestdocs.__main__._executors = old_executors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ Talk talk talk. | |
| Some more talk. | ||
|
|
||
| ```python | ||
| import random | ||
| import random | ||
|
|
||
| random.random() | ||
| ``` | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Talk talk talk. | ||
|
|
||
| ```bash | ||
| GREETING="hello" | ||
| ``` | ||
|
|
||
| Some more talk. | ||
|
|
||
| ```bash | ||
| for i in {1..4}; do | ||
| echo $i | ||
| done | ||
| ``` | ||
|
|
||
| This is not allowed. | ||
|
|
||
| ```bash | ||
| echo $GREETING | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| This is another test. | ||
|
|
||
| ```python | ||
| a = 1 | ||
| b = 2 | ||
| ``` | ||
|
|
||
| This shouldn't work. | ||
|
|
||
| ```python | ||
| assert add(1, 2) == 3 | ||
| ``` | ||
|
|
||
| It uses multiple languages. | ||
|
|
||
| ```bash | ||
| GREETING="hello" | ||
| ``` | ||
|
|
||
| This also shouldn't work. | ||
|
|
||
| ```bash | ||
| import math | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ Talk talk talk. | |
| Some more talk. | ||
|
|
||
| ```python | ||
| import random | ||
| import random | ||
|
|
||
| random.random() | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| Talk talk talk. | ||
|
|
||
| ```bash | ||
| GREETING="hello" | ||
| ``` | ||
|
|
||
| Some more talk. | ||
|
|
||
| ```bash | ||
| for i in {1..4}; do | ||
| echo $i | ||
| done | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't help but notice you using an extra tab here, presumably to display the ticks. I figured I'd share a trick, because there is an alternative syntax for moments like this. No need to change anything here, but I typically share this trick because many folks seem unaware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually just copying the md examples from elsewhere in the README. But no, I did not know that other way of including backtics; it will certainly be useful in the future.
I do find it interesting that I am finding out about this markdown formatting while working on mktestdocs. I believe the current mktestdocs would not execute these valid quadruple or pentuple, etc, code blocks. Perhaps that would be a valuable addition in the future?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa. This is indeed getting meta 😅 I'm the maintainer of mktestdocs and I did not even realise that the extra-ticks-markdown-formatting is related to the project.
I think I prefer to see it as an advanced use case that might be best to skip for now. I'd be interested in understanding the use-case a bit better before actually thinking about the feature. It should be easy for folks to build their own implementation in the meantime.