7 changed files with 71 additions and 66 deletions
@ -1,9 +1,9 @@
|
||||
# Unit tests requirements |
||||
|
||||
coverage>=4.5.0 # Apache-2.0 |
||||
junitxml>=0.7.0 # LGPL-3 |
||||
mock>=2.0.0 # BSD |
||||
os-testr>=1.0.0 # Apache-2.0 |
||||
psutil>=5.7.2 # BSD |
||||
python-subunit>=1.4.0 # Apache-2.0 |
||||
stestr>=3.0.0 # Apache-2.0 |
||||
ansi2html>=1.6.0 # LGPLv3+ |
||||
coverage>=4.5.0 # Apache-2.0 |
||||
mock>=2.0.0 # BSD |
||||
psutil>=5.7.2 # BSD |
||||
pytest>=6.0.0 # MIT |
||||
pytest-html>=3.0.0 # MPL-2.0 |
||||
pytest-xdist[psutil]>=2.0.0 # MIT |
||||
|
@ -0,0 +1,39 @@
|
||||
# Copyright (c) 2020 Red Hat |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
from __future__ import absolute_import |
||||
|
||||
from datetime import datetime |
||||
|
||||
from py.xml import html # pylint: disable=no-name-in-module,import-error |
||||
import pytest |
||||
|
||||
|
||||
def pytest_html_results_table_header(cells): |
||||
cells.insert(2, html.th("Description")) |
||||
cells.insert(1, html.th("Time", class_="sortable time", col="time")) |
||||
cells.pop() |
||||
|
||||
|
||||
def pytest_html_results_table_row(report, cells): |
||||
cells.insert(2, html.td(report.description)) |
||||
cells.insert(1, html.td(datetime.utcnow(), class_="col-time")) |
||||
cells.pop() |
||||
|
||||
|
||||
@pytest.hookimpl(hookwrapper=True) |
||||
def pytest_runtest_makereport(item, call): # pylint: disable=unused-argument |
||||
outcome = yield |
||||
report = outcome.get_result() |
||||
report.description = str(item.function.__doc__) |
Loading…
Reference in new issue