Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wabiloo opened this issue Mar 27, 2023 · 0 comments
Open

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

wabiloo opened this issue Mar 27, 2023 · 0 comments

Comments

@wabiloo
Copy link

wabiloo commented Mar 27, 2023

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant