Skip to content

Commit

Permalink
pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
xlz926 committed Feb 9, 2020
1 parent 4f729c1 commit c3b42b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To install pytest-html:
the first, you need to down load the chinese pytest-html
$ cd to pytest-html dir
$ pip uninstall pytest-html
$ python setup.py install
Then run your tests with:
Expand Down
5 changes: 2 additions & 3 deletions pytest_html/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class TestResult:
def __init__(self, outcome, report, logfile, config):
self.test_id = report.nodeid
if getattr(report, 'when', 'call') != 'call':
self.test_id = '::'.join([report.nodeid, report.when])
self.test_id = '::'.join([report.nodeid.encode("utf-8").decode("unicode_escape"), report.when])
self.time = getattr(report, 'duration', 0.0)
self.outcome = outcome
self.additional_html = []
Expand Down Expand Up @@ -441,8 +441,7 @@ def generate_summary_item(self):
class_='sortable result initial-sort',
col='result'),
html.th('用例', class_='sortable', col='name'),
html.th('耗时', class_='sortable numeric', col='duration'),
html.th('链接')]
html.th('耗时', class_='sortable numeric', col='duration')]
session.config.hook.pytest_html_results_table_header(cells=cells)

# results = [html.h2('Results'), html.table([html.thead(
Expand Down
2 changes: 1 addition & 1 deletion pytest_html/resources/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function reset_sort_headers() {
find_all('.sortable').forEach(function(elem) {
var icon = document.createElement("div");
icon.className = "sort-icon";
icon.textContent = "vvv";
icon.textContent = "字段";
elem.insertBefore(icon, elem.firstChild);
elem.classList.remove("desc", "active");
elem.classList.add("asc", "inactive");
Expand Down

0 comments on commit c3b42b1

Please sign in to comment.