We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cef92ef commit 89b58c4Copy full SHA for 89b58c4
1 file changed
tests/integration/logging_test.py
@@ -143,3 +143,18 @@ def test_session_log_level_bad():
143
error_msg = r'^Invalid log level \[99\]$'
144
with pytest.raises(LibsshSessionException, match=error_msg):
145
ssh_session.set_log_level(BAD_LOG_LEVEL)
146
+
147
148
+def test_session_log_verbosity_session(
149
+ caplog: pytest.LogCaptureFixture,
150
+ free_port_num: int,
151
+) -> None:
152
+ """Test setting the log level through Session constructor."""
153
+ ssh_session = Session(log_verbosity=ANSIBLE_PYLIBSSH_TRACE)
154
+ caplog.set_level(ANSIBLE_PYLIBSSH_TRACE)
155
156
+ with _ctx.suppress(LibsshSessionException):
157
+ ssh_session.connect(host=LOCALHOST, port=free_port_num)
158
159
+ expected_poll_message = 'ssh_socket_pollcallback: Poll callback on socket'
160
+ assert expected_poll_message in caplog.text
0 commit comments