Skip to content

Commit 4c96ea9

Browse files
jleratJulien Lerat
and
Julien Lerat
authored
fix: updated logger completion message (#13)
* doc: removed bitbucket pipeline [ci-skip] * chore: moved pipeline and created reduced conda env spec * fix: updated logger completion message * test: fix logger test --------- Co-authored-by: Julien Lerat <[email protected]>
1 parent 49d0705 commit 4c96ea9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

hydrodiy/io/iutils.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def started(self):
126126
self.info("@@@ Process started @@@")
127127

128128
def completed(self):
129+
self.context = ""
130+
self.info("")
129131
self.info("@@@ Process completed @@@")
130132

131133

hydrodiy/io/tests/test_hyio_iutils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_get_logger():
146146
with open(flog2, "r") as fl:
147147
txt = fl.readlines()
148148
expected = ["@@@ Process started @@@"]+mess+\
149-
["@@@ Process completed @@@"]
149+
["", "@@@ Process completed @@@"]
150150
assert expected == [t.strip() for t in txt]
151151

152152
# Close log file handler and delete files
@@ -181,7 +181,7 @@ def test_get_logger_contextual():
181181
ck = bool(re.search("@@@ Process started @@@", txt[0]))
182182
ck &= bool(re.search("\\{ context1 \\}", txt[1]))
183183
ck &= bool(re.search("\\{ context2 \\}", txt[2]))
184-
ck &= bool(re.search("@@@ Process completed @@@", txt[3]))
184+
ck &= bool(re.search("@@@ Process completed @@@", txt[4]))
185185
assert ck
186186

187187
logger.handlers[1].close()

0 commit comments

Comments
 (0)