pytest-dev / pytest-dev/pytest-html
Logs that are redirected to files are equally included in the HTML report
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
log.py
import logging
def test_log():
logging.info("Hello world")
Execute:
pytest log.py --html=report.html --log-level=CRITICAL --log-file=debug.log --log-file-level=INFO
Actual result :
- File
debug.logsuccessfully created with the intended log content (OK) - File
report.htmlincludes INFO logs in theCaptured stderr callsection (NOK)
------------------------------Captured stderr call------------------------------
INFO:root:Hello world
Expected result :
File report.html doesn't include INFO logs (only CRITICAL or higher levels)
Same result if I add the following pytest.ini file
[pytest]
log_cli=false
log_cli_level = CRITICAL
Environment:
Python 3.8.5
pytest-6.2.2
pytest-html-3.1.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the command with log.py, --html=report.html, --log-level=CRITICAL, --log-file=debug.log, and --log-file-level=INFO; compare debug.log with the Captured stderr call section in report.html. Done means INFO appears in debug.log but not in the HTML report, while logs at CRITICAL or higher remain included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100