forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
I have a simple test:
import logging
LOGGER = logging.getLogger(__name__)
def test():
a = 888
LOGGER.info(">>>>>> Test1 <<<<<<<<<<<<< %s", a)
assert FalseI configuted pytest so it is logging at info level.
See pyproject.toml:
[tool.pytest.ini_options]
log_cli_level="INFO"When I execute the test with pytest tests it shows this:
tests/test_log.py F [100%]
=================================================================== FAILURES ====================================================================
_____________________________________________________________________ test ______________________________________________________________________
def test():
a = 888
LOGGER.info(">>>>>> Test1 <<<<<<<<<<<<< %s", a)
> assert False
E assert False
tests/test_log.py:9: AssertionError
--------------------------------------------------------------- Captured log call ---------------------------------------------------------------
INFO tests.test_log:test_log.py:8 >>>>>> Test1 <<<<<<<<<<<<< 888
============================================================ short test summary info ============================================================
FAILED tests/test_log.py::test - assert False
=============================================================== 1 failed in 0.04s ===============================================================
Please not that it also shows the log output - which is this:
INFO tests.test_log:test_log.py:8 >>>>>> Test1 <<<<<<<<<<<<< 888.
I also want to see this logging output on the VSCode snippet that shows up at failed test functions. See screenshot:
Can you add the log output?
knaoe
Metadata
Metadata
Assignees
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
