Skip to content

Commit 4086b9e

Browse files
committed
squash commits
1 parent 3f63686 commit 4086b9e

File tree

14 files changed

+445
-171
lines changed

14 files changed

+445
-171
lines changed

.github/workflows/actions.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ jobs:
7474
name: pypy3-ubuntu
7575
python-version: pypy3
7676

77-
# Disabling due to https://github.com/actions/setup-python/issues/151
78-
# - os: windows-latest
79-
# name: pypy3-windows
80-
# python-version: pypy3
77+
- os: windows-latest
78+
name: pypy3-windows
79+
python-version: pypy3
8180

8281
- os: macOS-latest
8382
name: pypy3-mac

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ repos:
5252
files: ^(CHANGES.rst|development.rst|README.rst)$
5353
language: python
5454
additional_dependencies: [pygments, restructuredtext_lint]
55+
- repo: https://github.com/elidupuis/mirrors-sass-lint
56+
rev: '5cc45653263b423398e4af2561fae362903dd45d'
57+
hooks:
58+
- id: sass-lint

CHANGES.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
Release Notes
22
-------------
33

4-
**3.1.0 (unreleased)**
4+
**3.1.1 (unreleased)**
5+
6+
* Fix issue with reporting of missing CSS files. (`#388 <https://github.com/pytest-dev/pytest-html/issues/388>`_)
7+
8+
* Thanks to `@prakhargurunani <https://github.com/prakhargurunani>`_ for reporting and fixing!
9+
10+
**3.1.0 (2020-12-2)**
11+
12+
* Stop attaching test reruns to final test report entries (`#374 <https://github.com/pytest-dev/pytest-html/issues/374>`_)
13+
14+
* Thanks to `@VladimirPodolyan <https://github.com/VladimirPodolyan>`_ for reporting and `@gnikonorov <https://github.com/gnikonorov>`_ for the fix
515

616
* Allow for report duration formatting (`#376 <https://github.com/pytest-dev/pytest-html/issues/376>`_)
717

README.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,18 @@ be used to change the appearance of the report.
9090
Report Title
9191
~~~~~~~~~~~~
9292

93-
By default report title will be the filename of the report, you can edit it by using the :code: `pytest_html_report_title` hook:
93+
By default report title will be the filename of the report, you can edit it by using the :code:`pytest_html_report_title` hook:
9494

9595
.. code-block:: python
9696
97-
import pytest
98-
from py.xml import html
99-
100-
10197
def pytest_html_report_title(report):
10298
report.title = "My very own title!"
10399
104100
Environment
105101
~~~~~~~~~~~
106102

107103
The *Environment* section is provided by the `pytest-metadata
108-
<https://pypi.python.org/pypi/pytest-metadata/>`_, plugin, and can be accessed
104+
<https://pypi.python.org/pypi/pytest-metadata/>`_ plugin, and can be accessed
109105
via the :code:`pytest_configure` hook:
110106

111107
.. code-block:: python
@@ -123,7 +119,6 @@ You can edit the *Summary* section by using the :code:`pytest_html_results_summa
123119

124120
.. code-block:: python
125121
126-
import pytest
127122
from py.xml import html
128123
129124
@@ -248,9 +243,6 @@ following example removes all passed results from the report:
248243

249244
.. code-block:: python
250245
251-
import pytest
252-
253-
254246
def pytest_html_results_table_row(report, cells):
255247
if report.passed:
256248
del cells[:]
@@ -261,7 +253,7 @@ additional HTML and log output with a notice that the log is empty:
261253

262254
.. code-block:: python
263255
264-
import pytest
256+
from py.xml import html
265257
266258
267259
def pytest_html_results_table_html(report, data):

development.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@ Run the following to execute the tests:
7070
7171
$ npm test
7272
73+
SASS/SCSS/CSS
74+
-------------
75+
76+
You will need `npm <https://www.npmjs.com>`_ installed to compile the CSS,
77+
which is generated via `SASS/SCSS <https://sass-lang.com/>`_.
78+
79+
Once ``npm`` is installed, you can install all needed dependencies by running:
80+
81+
.. code-block:: bash
82+
83+
$ npm install
84+
85+
Run the following to generate the CSS:
86+
87+
.. code-block:: bash
88+
89+
$ npm run build:css
90+
7391
Releasing a new version
7492
-----------------------
7593

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
"grunt-contrib-qunit": "^4.0.0",
77
"phantomjs-prebuilt": "2.1.15"
88
},
9-
"devDependencies": {},
9+
"devDependencies": {
10+
"sass": "^1.29.0"
11+
},
1012
"scripts": {
11-
"test": "grunt test"
13+
"test": "grunt test",
14+
"build:css": "sass --no-source-map --no-error-css src/layout/css/style.scss src/pytest_html/resources/style.css"
1215
}
1316
}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ build-backend = "setuptools.build_meta"
1010

1111
[tool.setuptools_scm]
1212
local_scheme = "no-local-version"
13+
write_to = "src/pytest_html/__version.py"

src/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# see https://github.com/github/linguist#generated-code
3+
pytest_html/resources/style.css linguist-generated

src/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# file generated by setuptools_scm. don't track in version control
3+
pytest_html/__version.py

src/layout/css/style.scss

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
body {
2+
font-family: Helvetica, Arial, sans-serif;
3+
font-size: 12px;
4+
/* do not increase min-width as some may use split screens */
5+
min-width: 800px;
6+
color: #999;
7+
}
8+
9+
h1 {
10+
font-size: 24px;
11+
color: black;
12+
}
13+
14+
h2 {
15+
font-size: 16px;
16+
color: black;
17+
}
18+
19+
p {
20+
color: black;
21+
}
22+
23+
a {
24+
color: #999;
25+
}
26+
27+
table {
28+
border-collapse: collapse;
29+
}
30+
31+
/******************************
32+
* SUMMARY INFORMATION
33+
******************************/
34+
35+
#environment td {
36+
padding: 5px;
37+
border: 1px solid #E6E6E6;
38+
}
39+
40+
#environment tr:nth-child(odd) {
41+
background-color: #f6f6f6;
42+
}
43+
44+
/******************************
45+
* TEST RESULT COLORS
46+
******************************/
47+
span.passed, .passed .col-result {
48+
color: green;
49+
}
50+
span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
51+
color: orange;
52+
}
53+
span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
54+
color: red;
55+
}
56+
57+
58+
/******************************
59+
* RESULTS TABLE
60+
*
61+
* 1. Table Layout
62+
* 2. Extra
63+
* 3. Sorting items
64+
*
65+
******************************/
66+
67+
/*------------------
68+
* 1. Table Layout
69+
*------------------*/
70+
71+
#results-table {
72+
border: 1px solid #e6e6e6;
73+
color: #999;
74+
font-size: 12px;
75+
width: 100%
76+
}
77+
78+
#results-table th, #results-table td {
79+
padding: 5px;
80+
border: 1px solid #E6E6E6;
81+
text-align: left
82+
}
83+
#results-table th {
84+
font-weight: bold
85+
}
86+
87+
/*------------------
88+
* 2. Extra
89+
*------------------*/
90+
91+
.log:only-child {
92+
height: inherit
93+
}
94+
.log {
95+
background-color: #e6e6e6;
96+
border: 1px solid #e6e6e6;
97+
color: black;
98+
display: block;
99+
font-family: "Courier New", Courier, monospace;
100+
height: 230px;
101+
overflow-y: scroll;
102+
padding: 5px;
103+
white-space: pre-wrap
104+
}
105+
div.image {
106+
border: 1px solid #e6e6e6;
107+
float: right;
108+
height: 240px;
109+
margin-left: 5px;
110+
overflow: hidden;
111+
width: 320px
112+
}
113+
div.image img {
114+
width: 320px
115+
}
116+
div.video {
117+
border: 1px solid #e6e6e6;
118+
float: right;
119+
height: 240px;
120+
margin-left: 5px;
121+
overflow: hidden;
122+
width: 320px
123+
}
124+
div.video video {
125+
overflow: hidden;
126+
width: 320px;
127+
height: 240px;
128+
}
129+
.collapsed {
130+
display: none;
131+
}
132+
.expander::after {
133+
content: " (show details)";
134+
color: #BBB;
135+
font-style: italic;
136+
cursor: pointer;
137+
}
138+
.collapser::after {
139+
content: " (hide details)";
140+
color: #BBB;
141+
font-style: italic;
142+
cursor: pointer;
143+
}
144+
145+
/*------------------
146+
* 3. Sorting items
147+
*------------------*/
148+
.sortable {
149+
cursor: pointer;
150+
}
151+
152+
.sort-icon {
153+
font-size: 0px;
154+
float: left;
155+
margin-right: 5px;
156+
margin-top: 5px;
157+
/*triangle*/
158+
width: 0;
159+
height: 0;
160+
border-left: 8px solid transparent;
161+
border-right: 8px solid transparent;
162+
}
163+
164+
.inactive .sort-icon {
165+
/*finish triangle*/
166+
border-top: 8px solid #E6E6E6;
167+
}
168+
169+
.asc.active .sort-icon {
170+
/*finish triangle*/
171+
border-bottom: 8px solid #999;
172+
}
173+
174+
.desc.active .sort-icon {
175+
/*finish triangle*/
176+
border-top: 8px solid #999;
177+
}

0 commit comments

Comments
 (0)