Skip to content

Commit

Permalink
🩹 Minor fix to add compatibility with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris-INSA committed Jun 25, 2024
1 parent 1845360 commit 7614227
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/functional/hermesintegrationtestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ def run(self):
# Remove all logger handlers to avoid duplicates if client is restarted
self.logger = None
while __hermes__.logger.hasHandlers():
hdlr = __hermes__.logger.handlers[0]
try:
hdlr = __hermes__.logger.handlers[0]
except IndexError:
break
hdlr.flush()
hdlr.close()
__hermes__.logger.removeHandler(hdlr)
Expand Down Expand Up @@ -307,7 +310,10 @@ def run(self):
# Remove all logger handlers to avoid duplicates if server is restarted
self.logger = None
while __hermes__.logger.hasHandlers():
hdlr = __hermes__.logger.handlers[0]
try:
hdlr = __hermes__.logger.handlers[0]
except IndexError:
break
hdlr.flush()
hdlr.close()
__hermes__.logger.removeHandler(hdlr)
Expand Down

0 comments on commit 7614227

Please sign in to comment.