-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
Normal case
I have this very simple test which is just logging some unicode character:
test_log.py
import logging
logger = logging.getLogger(__name__)
def test():
logger.info("Normal")
logger.info("\u251c")
logger.info("Also normal")
And when I run it using --log-cli-level=INFO
then I get this terminal output, which is fine:
============================= test session starts =============================
platform win32 -- Python 3.6.3, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- c:\users\victor\desktop\pytest unicode bug\venv\scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\Victor\Desktop\pytest unicode bug, inifile:
collected 1 item
test_log.py::test
-------------------------------- live log call --------------------------------
test_log.py 6 INFO Normal
test_log.py 7 INFO ├
test_log.py 8 INFO Also normal
PASSED [100%]
========================== 1 passed in 0.02 seconds ===========================
Save to file
However, when I also run with --log-file=logoutput
, this is what I get:
logoutput contents:
test_log.py 6 INFO Normal
test_log.py 8 INFO Also normal
So it seems that the lines with unicode characters are not getting printed in the log file, which is a problem.
Environment details
- pytest 3.6.2
- Windows 10
Metadata
Metadata
Assignees
Labels
plugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed