We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37102e9 commit f666daeCopy full SHA for f666dae
tests/unit/channel_test.py
@@ -58,6 +58,14 @@ def test_exec_command(ssh_channel):
58
exec_second_command(ssh_channel)
59
60
61
+def test_exec_command_stderr(ssh_channel):
62
+ """Test getting the stderr of a remotely executed command."""
63
+ u_cmd = ssh_channel.exec_command('echo -n Hello World 1>&2')
64
+ assert u_cmd.returncode == 0
65
+ assert u_cmd.stderr.decode() == u'Hello World' # noqa: WPS302
66
+ assert u_cmd.stdout.decode() == ''
67
+
68
69
def test_double_close(ssh_channel):
70
"""Test that closing the channel multiple times doesn't explode."""
71
for _ in range(3): # noqa: WPS122
0 commit comments