forked from nilearn/nilearn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MAINT] use pytest-reporter-html1 to create test reports (nilearn#4444)
* use "pytest-reporter-html1" for creating reports * add report template * improve layout * sort warning by types * build report even on failure * build report for test on codebase and not doc * do not on doc * reuse original template * refactor template
- Loading branch information
Showing
6 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ venv/ | |
|
||
# testing | ||
.pytest_cache | ||
report.html | ||
|
||
# CI benchmark | ||
maint_tools/*_runs_timing.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- Print the warnings sorted by type first and then by filename --> | ||
|
||
{% extends "html1/index.html" %} | ||
<!-- URL of the extended template --> | ||
<!-- https://github.com/christiansandberg/pytest-reporter-html1/blob/master/pytest_reporter_html1/templates/html1/index.html --> | ||
|
||
{% block style %} | ||
{{ super() }} | ||
|
||
.warning-list { | ||
margin-left: 24px; | ||
margin-top: 12px; | ||
widt: 90%; | ||
} | ||
|
||
#warnings ul { | ||
padding: 0; | ||
margin-left: 24px; | ||
display: block; | ||
} | ||
|
||
#warnings li { | ||
display: block; | ||
margin-bottom: 8px; | ||
} | ||
|
||
{% endblock %} | ||
|
||
{% set title = "Nilearn test report" %} | ||
|
||
{% block warnings %} | ||
<div class="container"> | ||
<h1>Warnings</h1> | ||
<details class="file"> | ||
<summary> | ||
<h2 class="title file-title"> | ||
<span class="fspath"> WARNINGS </span> | ||
<span class="counts"> | ||
<span title="{{ warnings|count }}" | ||
class="status badge warning"> | ||
{{ warnings|count }} | ||
</span> | ||
</span> | ||
</h2> | ||
</summary> | ||
|
||
{% set warning_types = warnings|map(attribute='category')|unique|list %} | ||
{% for type in warning_types %} | ||
|
||
{% set nb_warning = namespace(value=0) %} | ||
{% for warning in warnings %} | ||
{% if warning.category == type %} | ||
{% set nb_warning.value = nb_warning.value + 1 %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
<details class="warning-list"> | ||
<summary> | ||
<div class="status"> | ||
{{ type.__name__ }} | ||
<span class="badge warning counts">{{ nb_warning.value }}</span> | ||
</div> | ||
</summary> | ||
<ul> | ||
{% for warning in warnings|sort(attribute="filename") %} | ||
{% if warning.category == type %} | ||
<li> | ||
<div> | ||
<span class="filename">{{ warning.filename }}:{{ warning.lineno }}</span><br /> | ||
{{ warning.message }} | ||
</div> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</details> | ||
{% endfor %} | ||
</details> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters