File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -134,17 +134,13 @@ This markdown could be fully tested like this
134134
135135``` python
136136import pathlib
137- import pytest
138137
139138from mktestdocs import check_md_file
140139
141140fpath = pathlib.Path(" docs" ) / " bash-support.md"
142141
143- def test_python_examples ():
144- check_md_file(fpath = fpath, lang = " python" )
145-
146- def test_bash_examples ():
147- check_md_file(fpath = fpath, lang = " bash" )
142+ check_md_file(fpath = fpath, lang = " python" )
143+ check_md_file(fpath = fpath, lang = " bash" )
148144```
149145
150146## Additional Language Support
@@ -168,16 +164,12 @@ You could create a json validator that tested the example was always valid json
168164import json
169165import pathlib
170166
171- import pytest
172-
173167from mktestdocs import check_md_file, register_executor
174168
175169def parse_json (json_text ):
176170 json.loads(json_text)
177171
178172register_executor(" json" , parse_json)
179173
180- def test_files_good (fpath ):
181- fpath = pathlib.Path(" docs" ) / " additional-language-support.md"
182- check_md_file(fpath = fpath)
174+ check_md_file(fpath = pathlib.Path(" docs" ) / " additional-language-support.md" , lang = " json" )
183175```
Original file line number Diff line number Diff line change 11This is an example REST response
22
3- ``` json
4- {body: {results: [spam, eggs] }, errors: []}
3+ ``` json
4+ {" body" : {" results" : [" spam" , " eggs" ]}, " errors" : []}
55```
You can’t perform that action at this time.
0 commit comments