Skip to content

Commit

Permalink
Upgrade pytest-reporter to 0.4.0 (for xdist)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiansandberg committed Aug 16, 2020
1 parent 303c8d9 commit 25e06fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
1 change: 0 additions & 1 deletion pytest_reporter_html1/templates/html1/module.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% block module_content scoped %}
{% set ns = namespace(used_sections=[]) %}
{% for test in tests %}
<details class="test {{ test.status.category }}">
<summary>
Expand Down
30 changes: 11 additions & 19 deletions pytest_reporter_html1/templates/html1/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
{% block test_metadata scoped %}
<tr>
<th>Started</th>
<td>{{ test.phases|map(attribute='call.start')|first|strftime(time_format) }}</td>
<td>{{ test.started|strftime(time_format) }}</td>
</tr>
<tr>
<th>Ended</th>
<td>{{ test.phases|map(attribute='call.stop')|list|last|strftime(time_format) }}</td>
<td>{{ test.ended|strftime(time_format) }}</td>
</tr>
<tr>
<th>Duration</th>
Expand Down Expand Up @@ -86,10 +86,10 @@
{% endfor %}
{% endblock %}
</table>
{% for phase in test.phases if phase.call.excinfo %}
<div class="repr">
<pre>{{ phase.call.excinfo.exconly(tryshort=True) }}</pre>
</div>
{% for phase in test.phases if phase.report.longrepr and 'call' in phase %}
<div class="repr">
<pre>{{ phase.call.excinfo.exconly(tryshort=True) }}</pre>
</div>
{% endfor %}
<div class="test-phases">
{% for phase in test.phases %}
Expand All @@ -108,19 +108,11 @@ <h4 class="title">
<pre>{{ phase.report.longreprtext }}</pre>
</div>
{% endif %}
{% for section, content in phase.report.sections %}
{#
Need to remember which sections have already been reported as
all previous sections for a single item get included in the next call.
#}
{% set section_id = content|id %}
{% if section_id not in ns.used_sections %}
{% set ns.used_sections = ns.used_sections + [section_id] %}
<div class="section">
<h5 class="section-title">{{ section }}</h5>
<pre><samp>{{ content|escape|replace('\r\n', '\n')|ansi|safe }}</samp></pre>
</div>
{% endif %}
{% for section, content in phase.sections %}
<div class="section">
<h5 class="section-title">{{ section }}</h5>
<pre><samp>{{ content|escape|replace('\r\n', '\n')|ansi|safe }}</samp></pre>
</div>
{% endfor %}
</div>
</details>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def read(fname):
python_requires='>=3.5',
setup_requires=['setuptools_scm'],
install_requires=[
'pytest-reporter>=0.3.0',
'pytest-reporter>=0.4.0',
'Jinja2',
'ansi2html>=1.3.0',
'htmlmin',
Expand Down

0 comments on commit 25e06fc

Please sign in to comment.