Html report not generated if logs include unicode character
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?
What version are you using? Please try 4.0.0rc4
What version are you using? Please try
4.0.0rc4
my pytest version: 7.3.1 my pytest_html version: 3.2.0
Please try 4.0.0rc4 and see if the issue remains.
Please try 4.0.0rc4 and see if the issue remains.
In this version, the issue is resolved. But the hyperlink to html file doesn't work. Can't click on the link to open the html file from console
Please try 4.0.0rc4 and see if the issue remains.
In this version, the issue is resolved. But the hyperlink to html file doesn't work. Can't click on the link to open the html file from console
Interesting. What OS are you using?
Do you get an error? Does the wrong page load? Some more info would be great.
It works for me on Mac.
Can you share a screenshot of the link or similar? Also what params are you sending in to pytest? Are you using any variable expansions or similar?
I am using pytest in windows. The correct link shows. If I copy the link and paste it in browser, it opens the correct html file. But I can't directly click on the link on pycharm console. Can't post screenshot due to company policy. But I see, the difference from 3.2.0 version is, it shows path with '\' file separator whereas previous one was '/'
This is what I'm seeing on Windows: Generated html report: file://D:\a\pytest-html\pytest-html\.tox\py3.9\log\report.html
Is yours different?
Oh, I see now. In the legacy version the printed path was POSIX and not Windows: file:///D:/a/pytest-html/pytest-html/.tox/py38-cov/log/report.html
The question then becomes, which is the correct one.
Are you using WSL? What console/terminal are you using? What IDE?
There are multiple use-cases here and I just want to make sure we get it correct.
Unfortunately I use an M1 Mac which means I can't run Windows on it.
I am using windows 10 pro 22H2 version and pycharm IDE 2021.3.2 version's terminal
This is what I'm seeing on Windows:
Generated html report: file://D:\a\pytest-html\pytest-html\.tox\py3.9\log\report.htmlIs yours different?
Mine is same like this in rc4 version. Can you click on the link?