Skip to content

Commit

Permalink
test_workhelper: force default loglevel for caplog (#915)
Browse files Browse the repository at this point in the history
commit-id:c6bd5449
  • Loading branch information
dhalperi authored Jul 8, 2024
1 parent 04bdf74 commit 9cd9473
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/client/test_workhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import datetime
import json
import logging
from unittest.mock import patch

import pytest
Expand Down Expand Up @@ -138,7 +139,8 @@ def test_print_workstatus_fresh_task(caplog):
],
}
)
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
with caplog.at_level(logging.DEBUG):
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
assert "status: TEST" in caplog.text
assert (
".... {obtained} Fooing the bar".format(
Expand Down Expand Up @@ -170,7 +172,8 @@ def test_print_workstatus_fresh_task_subtasks(caplog):
],
}
)
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
with caplog.at_level(logging.DEBUG):
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
assert "status: TEST" in caplog.text
assert (
".... {obtained} Fooing the bar 1 / 2.".format(
Expand Down Expand Up @@ -202,7 +205,8 @@ def test_print_workstatus_old_task(caplog):
],
}
)
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
with caplog.at_level(logging.DEBUG):
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
assert "status: TEST" in caplog.text
assert (
".... {obtained} Fooing the bar. (1y27d13:16:39 elapsed)".format(
Expand Down Expand Up @@ -234,7 +238,8 @@ def test_print_workstatus_old_task_subtasks(caplog):
],
}
)
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
with caplog.at_level(logging.DEBUG):
_print_work_status_helper(session, workStatus, taskDetails, nowFunction)
assert "status: TEST" in caplog.text
assert (
".... {obtained} Fooing the bar 1 / 2. (1y27d13:16:39 elapsed)".format(
Expand Down

0 comments on commit 9cd9473

Please sign in to comment.