@@ -39,6 +39,7 @@ Test command line utilities and applications by whitelisting them with app-speci
3939 >> > tester = Runner()
4040 >> > tester.call_engines[' echo' ] = SubprocessValidator()
4141 >> > tester.teststring(test_str)
42+ # echo 'Pining for the fjords'
4243
4344 Click applications
4445~~~~~~~~~~~~~~~~~~
@@ -66,6 +67,7 @@ This can now be tested in docstrings:
6667 ...
6768 ... $ hello Polly Parrot
6869 ... Usage: hello [OPTIONS] NAME
70+ ... Try "hello --help" for help.
6971 ... <BLANKLINE>
7072 ... Error: Got unexpected extra argument (Parrot)
7173 ...
@@ -83,6 +85,9 @@ Click applications can be tested with a ``ClickValidator`` engine:
8385 >> > tester.call_engines[' hello' ] = ClickValidator(hello)
8486
8587 >> > tester.teststring(test_str)
88+ # hello Polly
89+ # hello Polly Parrot
90+ # hello 'Polly Parrot'
8691
8792
8893 Mixed applications
@@ -120,6 +125,10 @@ Your app can be combined with other command-line utilities by adding multiple en
120125 >> > tester.call_engines[' cat' ] = SubprocessValidator()
121126
122127 >> > tester.teststring(test_str)
128+ # hello Polly
129+ # echo 'Pining for the fjords'
130+ # python -c "with open('tmp.txt', 'w+') as f: f.write('Pushing up daisies')"
131+ # cat tmp.txt
123132
124133 Suppressing commands
125134~~~~~~~~~~~~~~~~~~~~
@@ -131,14 +140,15 @@ Commands can be skipped altogether with a ``SkipValidator``:
131140 >> > test_str = '''
132141 ... .. code-block:: bash
133142 ...
134- ... $ aws storage buckets list
143+ ... $ aws storage buckets list --password $MY_PASSWORD
135144 ...
136145 ... '''
137146
138147 >> > from bashdoctest.validators import SkipValidator
139148 >> > tester.call_engines[' aws' ] = SkipValidator()
140149
141150 >> > tester.teststring(test_str)
151+ # aws storage ...
142152
143153
144154 Illegal commands
@@ -190,6 +200,7 @@ Unrecognized commands will not raise an error if +SKIP is specified
190200 ...
191201 ... '''
192202 >> > tester.teststring(test_str)
203+ # nmake all
193204
194205 Error handling
195206~~~~~~~~~~~~~~
@@ -212,10 +223,9 @@ Lines failing to match the command's output will raise an error
212223 >> > tester.teststring(test_str) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
213224 Traceback (most recent call last):
214225 ...
215- ValueError : bashdoctest test failed. There, it moved!
216- != " No it didn't!"
217- + There, it moved!
218- - " No it didn't!"
226+ ValueError : Differences (ndiff with - expected + actual):
227+ - " No it didn't!"
228+ + There, it moved!
219229
220230 Known issues
221231------------
@@ -245,10 +255,9 @@ All arguments to commands are passed as arguments to the first command. Therefor
245255 >> > tester.teststring(test_str) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
246256 Traceback (most recent call last):
247257 ...
248- ValueError : bashhdoctest test failed. hello > test.txt
249- !=
250- + hello > test.txt
251- -
258+ ValueError : Differences (ndiff with - expected + actual):
259+ + hello > test.txt
260+ < BLANKLINE >
252261
253262
254263
0 commit comments