Skip to content

Commit f5e5b4a

Browse files
committed
Displaying timezone information in HTML report
1 parent f318f93 commit f5e5b4a

40 files changed

+42
-42
lines changed

coverage/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def __init__(self, cov):
200200
'__url__': coverage.__url__,
201201
'__version__': coverage.__version__,
202202
'title': title,
203-
'time_stamp': datetime.datetime.now().strftime('%Y-%m-%d %H:%M'),
203+
'time_stamp': datetime.datetime.now().astimezone().strftime('%Y-%m-%d %H:%M %z'),
204204
'extra_css': self.extra_css,
205205
'has_arcs': self.has_arcs,
206206
'show_contexts': self.config.show_contexts,

tests/gold/html/a/a_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="stats">
6161
<div class="content">
6262
<p>
6363
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
64-
created at 2019-10-14 09:27
64+
created at 2019-10-14 09:27 +0000
6565
</p>
6666
</div>
6767
</div>

tests/gold/html/a/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Coverage report:
7676
<div class="content">
7777
<p>
7878
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
79-
created at 2019-10-14 09:27
79+
created at 2019-10-14 09:27 +0000
8080
</p>
8181
</div>
8282
</div>

tests/gold/html/b_branch/b_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h2 class="stats">
8484
<div class="content">
8585
<p>
8686
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
87-
created at 2019-10-14 09:27
87+
created at 2019-10-14 09:27 +0000
8888
</p>
8989
</div>
9090
</div>

tests/gold/html/b_branch/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h1>Coverage report:
8484
<div class="content">
8585
<p>
8686
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
87-
created at 2019-10-14 09:27
87+
created at 2019-10-14 09:27 +0000
8888
</p>
8989
</div>
9090
</div>

tests/gold/html/bom/2/bom_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h2 class="stats">
6767
<div class="content">
6868
<p>
6969
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
70-
created at 2019-10-14 09:32
70+
created at 2019-10-14 09:32 +0000
7171
</p>
7272
</div>
7373
</div>

tests/gold/html/bom/2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Coverage report:
7676
<div class="content">
7777
<p>
7878
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
79-
created at 2019-10-13 11:41
79+
created at 2019-10-13 11:41 +0000
8080
</p>
8181
</div>
8282
</div>

tests/gold/html/bom/bom_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h2 class="stats">
6767
<div class="content">
6868
<p>
6969
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
70-
created at 2019-10-14 09:27
70+
created at 2019-10-14 09:27 +0000
7171
</p>
7272
</div>
7373
</div>

tests/gold/html/bom/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Coverage report:
7676
<div class="content">
7777
<p>
7878
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
79-
created at 2019-10-14 09:27
79+
created at 2019-10-14 09:27 +0000
8080
</p>
8181
</div>
8282
</div>

tests/gold/html/isolatin1/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Coverage report:
7676
<div class="content">
7777
<p>
7878
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
79-
created at 2019-10-14 09:27
79+
created at 2019-10-14 09:27 +0000
8080
</p>
8181
</div>
8282
</div>

tests/gold/html/isolatin1/isolatin1_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="stats">
6161
<div class="content">
6262
<p>
6363
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
64-
created at 2019-10-14 09:27
64+
created at 2019-10-14 09:27 +0000
6565
</p>
6666
</div>
6767
</div>

tests/gold/html/omit_1/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h1>Coverage report:
9797
<div class="content">
9898
<p>
9999
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
100-
created at 2019-10-14 09:27
100+
created at 2019-10-14 09:27 +0000
101101
</p>
102102
</div>
103103
</div>

tests/gold/html/omit_1/m1_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_1/m2_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_1/m3_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_1/main_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="stats">
6666
<div class="content">
6767
<p>
6868
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
69-
created at 2019-10-14 09:27
69+
created at 2019-10-14 09:27 +0000
7070
</p>
7171
</div>
7272
</div>

tests/gold/html/omit_2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h1>Coverage report:
9090
<div class="content">
9191
<p>
9292
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
93-
created at 2019-10-14 09:27
93+
created at 2019-10-14 09:27 +0000
9494
</p>
9595
</div>
9696
</div>

tests/gold/html/omit_2/m2_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_2/m3_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_2/main_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="stats">
6666
<div class="content">
6767
<p>
6868
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
69-
created at 2019-10-14 09:27
69+
created at 2019-10-14 09:27 +0000
7070
</p>
7171
</div>
7272
</div>

tests/gold/html/omit_3/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h1>Coverage report:
8383
<div class="content">
8484
<p>
8585
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
86-
created at 2019-10-14 09:27
86+
created at 2019-10-14 09:27 +0000
8787
</p>
8888
</div>
8989
</div>

tests/gold/html/omit_3/m3_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_3/main_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="stats">
6666
<div class="content">
6767
<p>
6868
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
69-
created at 2019-10-14 09:27
69+
created at 2019-10-14 09:27 +0000
7070
</p>
7171
</div>
7272
</div>

tests/gold/html/omit_4/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h1>Coverage report:
9090
<div class="content">
9191
<p>
9292
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
93-
created at 2019-10-14 09:27
93+
created at 2019-10-14 09:27 +0000
9494
</p>
9595
</div>
9696
</div>

tests/gold/html/omit_4/m1_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_4/m3_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_4/main_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="stats">
6666
<div class="content">
6767
<p>
6868
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
69-
created at 2019-10-14 09:27
69+
created at 2019-10-14 09:27 +0000
7070
</p>
7171
</div>
7272
</div>

tests/gold/html/omit_5/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h1>Coverage report:
8383
<div class="content">
8484
<p>
8585
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
86-
created at 2019-10-14 09:27
86+
created at 2019-10-14 09:27 +0000
8787
</p>
8888
</div>
8989
</div>

tests/gold/html/omit_5/m1_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2 class="stats">
5858
<div class="content">
5959
<p>
6060
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
61-
created at 2019-10-14 09:27
61+
created at 2019-10-14 09:27 +0000
6262
</p>
6363
</div>
6464
</div>

tests/gold/html/omit_5/main_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="stats">
6666
<div class="content">
6767
<p>
6868
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
69-
created at 2019-10-14 09:27
69+
created at 2019-10-14 09:27 +0000
7070
</p>
7171
</div>
7272
</div>

tests/gold/html/other/blah_blah_other_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h2 class="stats">
6060
<div class="content">
6161
<p>
6262
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
63-
created at 2019-10-14 09:27
63+
created at 2019-10-14 09:27 +0000
6464
</p>
6565
</div>
6666
</div>

tests/gold/html/other/here_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h2 class="stats">
6262
<div class="content">
6363
<p>
6464
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
65-
created at 2019-10-14 09:27
65+
created at 2019-10-14 09:27 +0000
6666
</p>
6767
</div>
6868
</div>

tests/gold/html/other/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h1>Coverage report:
8383
<div class="content">
8484
<p>
8585
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
86-
created at 2019-10-14 09:27
86+
created at 2019-10-14 09:27 +0000
8787
</p>
8888
</div>
8989
</div>

tests/gold/html/partial/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h1>Coverage report:
8484
<div class="content">
8585
<p>
8686
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
87-
created at 2019-10-14 12:01
87+
created at 2019-10-14 12:01 +0000
8888
</p>
8989
</div>
9090
</div>

tests/gold/html/partial/partial_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h2 class="stats">
7474
<div class="content">
7575
<p>
7676
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
77-
created at 2019-10-14 12:01
77+
created at 2019-10-14 12:01 +0000
7878
</p>
7979
</div>
8080
</div>

tests/gold/html/styled/a_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h2 class="stats">
6262
<div class="content">
6363
<p>
6464
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
65-
created at 2019-10-14 09:27
65+
created at 2019-10-14 09:27 +0000
6666
</p>
6767
</div>
6868
</div>

tests/gold/html/styled/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1>Coverage report:
7777
<div class="content">
7878
<p>
7979
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
80-
created at 2019-10-14 09:27
80+
created at 2019-10-14 09:27 +0000
8181
</p>
8282
</div>
8383
</div>

tests/gold/html/unicode/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Coverage report:
7676
<div class="content">
7777
<p>
7878
<a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
79-
created at 2019-10-14 09:27
79+
created at 2019-10-14 09:27 +0000
8080
</p>
8181
</div>
8282
</div>

tests/gold/html/unicode/unicode_py.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="stats">
6161
<div class="content">
6262
<p>
6363
<a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
64-
created at 2019-10-14 09:27
64+
created at 2019-10-14 09:27 +0000
6565
</p>
6666
</div>
6767
</div>

tests/test_html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def get_html_index_content(self):
7171
with open("htmlcov/index.html") as f:
7272
index = f.read()
7373
index = re.sub(
74-
r"created at \d{4}-\d{2}-\d{2} \d{2}:\d{2}",
75-
r"created at YYYY-MM-DD HH:MM",
74+
r"created at \d{4}-\d{2}-\d{2} \d{2}:\d{2} \+\d{4}",
75+
r"created at YYYY-MM-DD HH:MM +ZZZZ",
7676
index,
7777
)
7878
return index
@@ -620,7 +620,7 @@ def compare_html(expected, actual):
620620
scrubs = [
621621
(r'/coverage.readthedocs.io/?[-.\w/]*', '/coverage.readthedocs.io/VER'),
622622
(r'coverage.py v[\d.abc]+', 'coverage.py vVER'),
623-
(r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d', 'created at DATE'),
623+
(r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d \+\d\d\d\d', 'created at DATE'),
624624
# Some words are identifiers in one version, keywords in another.
625625
(r'<span class="(nam|key)">(print|True|False)</span>', r'<span class="nam">\2</span>'),
626626
# Occasionally an absolute path is in the HTML report.

0 commit comments

Comments
 (0)