Skip to content

Commit 2f6a185

Browse files
authored
Fix pytest caplog heisenbug introduced in PR #3559 (#3565)
Prior to this PR, this usage of caplog is dependent on the level of the root logger, which is not set by this test and so ends up being dependent on which tests have run before: sometimes the INFO logs output by htex.shutdown are not captured by caplog. This PR explicitly tells caplog to get at least INFO level logs, to capture the expected messages.
1 parent 4f139c2 commit 2f6a185

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

parsl/tests/test_htex/test_htex.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import pathlib
23
from subprocess import Popen, TimeoutExpired
34
from typing import Optional, Sequence
@@ -107,7 +108,8 @@ def kill_interchange(*args, **kwargs):
107108

108109
mock_ix_proc.terminate.side_effect = kill_interchange
109110

110-
htex.shutdown()
111+
with caplog.at_level(logging.INFO):
112+
htex.shutdown()
111113

112114
if started:
113115
assert mock_ix_proc.terminate.called

0 commit comments

Comments
 (0)