Open bhawna0612 opened 8 months ago
Hi Can someone point me that something is wrong in pytest-html version or I am doing something wrong?
Can you provide us with your actual test code, and how you run them (i.e. what command line options, etc.)? It's a lot easier to troubleshoot if there is a way of reproducing the issue.
I have provided already everything here https://github.com/pytest-dev/pytest-html/discussions/793#discussioncomment-8194436 Please take a look.
The test code which I am running is provided Commands which I am passing is provided The Terminal output is provided The pytest-html hook is provided which I am using is provide where I am skipping the Passed and skipped test cases to be shown in summary table.
Repeating everything again here
The Source code file name is test_login.py under folder test_cases The source code is content of test_login.py file:
class TestLogin:
def test_login(self):
print("test_valid_login")
assert 1 == 1
def test_invalid_login(self):
print("test_invalid_login")
assert 0 == 1
I have downloaded the html pytest version 4.1.1
This is the hook I am using to remove the passed tests from the results table. This hook is passed in Conftest.py file
def pytest_html_results_table_row(report, cells): if report.passed: del cells[:] elif report.skipped: del cells[:]
This is the command I am passing pytest .\test_cases\test_login.py --html report2.html
Pytest is collecting 2 tests and this is the terminal output. 1 failed, 1 passed
platform win32 -- Python 3.11.7, pytest-7.1.3, pluggy-1.3.0
rootdir: E:\git_repos\web-automation, configfile: pytest.ini
plugins: html-4.1.1, metadata-3.0.0, order-1.0.1, ordering-0.6, xdist-3.3.1
collected 2 items
test_cases\test_login.py .F
and this is the output I got. It doesn't show the count of passed tests.
This is pytest.ini file content
[pytest] filterwarnings = ignore::pytest.PytestCacheWarning render_collapsed = True
Just wondering what else could be needed to reproduce or I am misunderstanding something?
and I was expecting to have result like this so that even though passed tests are removed from the results table, but I would like to still see the total count of tests executed and how many have passed. Something like we have in version 3.2.0
Discussed in https://github.com/pytest-dev/pytest-html/discussions/793