Skip to content

Commit

Permalink
open() the test log file with corresponding encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
sjiang95 committed Apr 24, 2024
1 parent 1170843 commit 7b60ef0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tests/ignite/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,12 @@ def test_setup_logger_encoding(encoding, dirname):
logger.info(w)
logging.shutdown()

with open(fp, "r") as h:
with open(fp, "r", encoding=encoding) as h:
data = h.readlines()

if encoding == "utf-8":
assert len(data) == len(test_words)
for expected, output in zip(test_words, data):
assert expected in output
else:
# TODO: let's which OS will fail here
assert len(data) == len(test_words)
for expected, output in zip(test_words, data):
assert expected in output
assert len(data) == len(test_words)
for expected, output in zip(test_words, data):
assert expected in output


def test_deprecated():
Expand Down

0 comments on commit 7b60ef0

Please sign in to comment.