kondratyev-nv / vscode-python-test-adapter

Python Test Adapter for the VS Code Test Explorer
https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter
MIT License
117 stars 27 forks source link

Pytest logging output - where do I find it? #296

Open wabiloo opened 1 year ago

wabiloo commented 1 year ago

I'm adding some logging into my pytest logs (after enabling logging in the pyproject.toml).

However, I cannot figure out where I can find them. The Output window (for "Test Explorer" shows nothing when the test is successful, and is filled with the details of the assertion error if there is one, but the logs don't show either).

If I use the "standard" Test Explorer, those logs appear in the "Python Test Log". What's the equivalent for your (better in all other respects) Test Adapter?

For example:

LOGGER = logging.getLogger(__name__)

def test_1_is_1():
   LOGGER.info("Is it really?")
   assert 1 == 1

and in pyproject.toml:

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"