Skip to content

Commit 316dafd

Browse files
committed
Updated comment
1 parent 034ee38 commit 316dafd

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/pyscript/stdout_capture.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
# The unit test framework passes in the string being printed by the command finalization hook
66
hook_output = sys.argv[1]
77

8-
# hook_output will not be captured because there are no nested calls to onecmd_plus_hooks
8+
# Run a help command which results in 1 call to onecmd_plus_hooks
99
res = app('help')
10+
11+
# hook_output will not be captured because there are no nested calls to onecmd_plus_hooks
1012
if hook_output not in res.stdout:
1113
print("PASSED")
1214
else:
1315
print("FAILED")
1416

15-
# hook_output will be captured in the nested call to onecmd_plus_hooks that occurs in do_history()
17+
# Run the last command in the history
1618
res = app('history -r -1')
19+
20+
# All output of the history command will be captured. This includes all output of the commands
21+
# started in do_history() using onecmd_plus_hooks(), including any output in those commands' hooks.
22+
# Therefore we expect the hook_output to show up this time.
1723
if hook_output in res.stdout:
1824
print("PASSED")
1925
else:

0 commit comments

Comments
 (0)