]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
test_misc: Set log level tests-task
authorZack Cerza <zack@cerza.org>
Thu, 25 Jun 2026 20:45:44 +0000 (14:45 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 25 Jun 2026 20:51:35 +0000 (14:51 -0600)
So they don't rely on a previous test setting verbose mode.

Signed-off-by: Zack Cerza <zack@cerza.org>
tests/test_misc.py

index ca7533643d0f58e1600de98946ccad8a24895bd8..fccdf4a2b5021b0c756773d557fb530d1a4ccf3d 100644 (file)
@@ -1,4 +1,5 @@
 import argparse
+import logging
 import pytest
 import subprocess
 
@@ -20,7 +21,8 @@ def test_sh_normal(caplog):
 
 
 def test_sh_truncate(caplog):
-    assert misc.sh("/bin/echo -n AB ; /bin/echo C", 2) == "ABC\n"
+    with caplog.at_level(logging.DEBUG):
+        assert misc.sh("/bin/echo -n AB ; /bin/echo C", 2) == "ABC\n"
     assert "truncated" in caplog.text
     assert "ABC" not in caplog.text
 
@@ -35,8 +37,9 @@ def test_sh_fail(caplog):
                     'ABC\n' == record.message)
 
 def test_sh_progress(caplog):
-    assert misc.sh("echo AB ; sleep 0.1 ; /bin/echo C", 2) == "AB\nC\n"
-    records = caplog.records
+    with caplog.at_level(logging.DEBUG):
+        assert misc.sh("echo AB ; sleep 0.1 ; /bin/echo C", 2) == "AB\nC\n"
+        records = caplog.records
     assert ':sh: ' in records[0].message
     assert 'AB' == records[1].message
     assert 'C' == records[2].message