Skip to content

Commit dc5fe54

Browse files
committed
Describe shell and the directory ctx manager in more detail
1 parent 2c6cfc9 commit dc5fe54

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cli_test_helpers/commands.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ def shell(command, **kwargs):
1313
Execute a shell command capturing output and exit code.
1414
1515
This is a better version of ``os.system()`` that captures output and
16-
returns a convenient namespace object.
16+
returns a convenient namespace object with 3 values:
17+
18+
``exit_code``:
19+
The command's exit code
20+
``stdout``:
21+
The command's normal output
22+
``stderr``:
23+
The command's error output
1724
"""
1825
completed = run(command, shell=True, capture_output=True, check=False, **kwargs)
1926

cli_test_helpers/decorators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class RandomDirectoryContext(LoggingIsolationMixin, TemporaryDirectory):
7272
"""
7373
Change the execution directory to a random location, temporarily.
7474
75+
Use it to verify that your CLI application can operate from any
76+
location, and is independent from your development directory tree.
7577
Keyword arguments are optional and identical to the ones of
7678
`tempfile.TemporaryDirectory`_ of the Python standard library.
7779

0 commit comments

Comments
 (0)