Skip to content

Commit fdd1f39

Browse files
committed
only create links for text, url and json
1 parent 0c31c36 commit fdd1f39

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/pytest_html/nextgen.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ def pytest_sessionfinish(self, session):
206206
self._report.data["runningState"] = "Finished"
207207
self._generate_report()
208208

209+
@pytest.hookimpl(trylast=True)
210+
def pytest_terminal_summary(self, terminalreporter):
211+
terminalreporter.write_sep("-", f"Generated html report: file://{self._report_path}")
212+
209213
@pytest.hookimpl(trylast=True)
210214
def pytest_collection_finish(self, session):
211215
self._report.data["collectedItems"] = len(session.items)

src/pytest_html/resources/index.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</template>
7474
<template id="template_results-table__head--empty">
7575
<tr id="not-found-message">
76-
<th colspan="4">No results found. Try to check the filters</th>
76+
<th colspan="4">No results found. Check the filters.</th>
7777
</tr>
7878
</template>
7979
<!-- END TEMPLATES -->

src/pytest_html/scripts/dom.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ const dom = {
8282

8383
const media = []
8484
extras?.forEach(({ name, format_type, content }) => {
85-
const extraLink = aTag.content.cloneNode(true)
86-
const extraLinkItem = extraLink.querySelector('a')
87-
88-
extraLinkItem.href = content
89-
extraLinkItem.className = `col-links__extra ${format_type}`
90-
extraLinkItem.innerText = name
91-
resultBody.querySelector('.col-links').appendChild(extraLinkItem)
85+
if (['json', 'text', 'url'].includes(format_type)) {
86+
const extraLink = aTag.content.cloneNode(true)
87+
const extraLinkItem = extraLink.querySelector('a')
88+
89+
extraLinkItem.href = content
90+
extraLinkItem.className = `col-links__extra ${format_type}`
91+
extraLinkItem.innerText = name
92+
resultBody.querySelector('.col-links').appendChild(extraLinkItem)
93+
}
9294

9395
if (['image', 'video'].includes(format_type)) {
9496
media.push({ path: content, name, format_type })

0 commit comments

Comments
 (0)