pytest-dev / pytest-dev/pytest

Helpful information in logfiles generated by logging plugin

Open
#7,307 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

plugin: logging type: proposal
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

In our company we (want to) use the log file generated by pytest --log-file logfile.txt for debugging issues with our tests in our CI. We use a log
file because even the failed tests may contain a lot of log messages, that
would spam the console output of pytest.

If there are some failing tests, the exceptions are unfortunately not part
of the log file, because the logging module doesn't create logging message
on it's own.

It would be helpful for debugging purposes, if the generated log file
contained not only the traceback (as is output to stdout by the pytest
frontend) but also separator lines, like the ones used for the live logging
output, e.g. --- live log setup ---.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with pytest --log-file logfile.txt and a failing test, then compare the generated file with the live logging output. Trace the logging plugin entry point and existing tests for log-file and live-log behavior. Done means the file includes separator lines such as the setup section and the failure traceback without flooding console output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.