pytest-dev / pytest-dev/pytest-html
Html report not generated if logs include unicode character
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
This test does not generate html report:
def test_encode(self): var = "just random print:"+"'\u200e'" print(var)
But this test does:
def test_encode(self): var = "just random print:"+"'\u200e'" var = str(var.encode('utf-8')) print(var)
Is there any way to handle this from conftest.py? so that explicit encoding is not needed in every print statements?
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 two test_encode examples from the issue, first with the Unicode character printed directly and then with the explicit UTF-8 encoding. Inspect conftest.py and the HTML report generation path to find where the direct output fails. Done means the HTML report is generated for the direct Unicode print without requiring encoding in each test.
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
- Mostly clear
- Newbie friendliness
- 42/100