Skip to content

Commit 6dc58cf

Browse files
committed
added collected items
1 parent f143891 commit 6dc58cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pytest_html/plugin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ def __init__(self, config, data_file):
777777
self._title = "Next Gen Report"
778778
self._data = {
779779
"title": self._title,
780+
"collectedItems": 0,
780781
"environment": {},
781782
"tests": [],
782783
}
@@ -803,6 +804,11 @@ def pytest_sessionstart(self, session):
803804
self._data["environment"] = metadata
804805
self._write()
805806

807+
@pytest.hookimpl(trylast=True)
808+
def pytest_collection_finish(self, session):
809+
self._data["collectedItems"] = len(session.items)
810+
self._write()
811+
806812
@pytest.hookimpl(trylast=True)
807813
def pytest_runtest_logreport(self, report):
808814
data = self._config.hook.pytest_report_to_serializable(

0 commit comments

Comments
 (0)