Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c007f49

Browse files
author
Alexis Bienvenüe
committed
Change SOURCE_DATE_EPOCH test date, to use two-digits numbers for month, day of month and times.
This way we don't mind if timestamps are written with leading 0 or space.
1 parent 8f095f6 commit c007f49

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/matplotlib/testing/determinism.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _test_determinism_save(filename, objects='mhi', format="pdf"):
1414
# to a constant value, so that time difference is not
1515
# taken into account
1616
sde = os.environ.pop('SOURCE_DATE_EPOCH', None)
17-
os.environ['SOURCE_DATE_EPOCH'] = "946684800"
17+
os.environ['SOURCE_DATE_EPOCH'] = "976875010"
1818

1919
fig = plt.figure()
2020

@@ -100,7 +100,7 @@ def _test_determinism(objects='mhi', format="pdf", uid=""):
100100
def _test_source_date_epoch(format, string, keyword=b"CreationDate"):
101101
"""
102102
Test SOURCE_DATE_EPOCH support. Output a document with the envionment
103-
variable SOURCE_DATE_EPOCH set to 2000-01-01 00:00 UTC and check that the
103+
variable SOURCE_DATE_EPOCH set to 2000-12-15 10:10:10 UTC and check that the
104104
document contains the timestamp that corresponds to this date (given as an
105105
argument).
106106
@@ -109,7 +109,7 @@ def _test_source_date_epoch(format, string, keyword=b"CreationDate"):
109109
format : str
110110
format string, such as "pdf".
111111
string : str
112-
timestamp string for 2000-01-01 00:00 UTC.
112+
timestamp string for 2000-12-15 10:10:10 UTC.
113113
keyword : str
114114
a string to look at when searching for the timestamp in the document
115115
(used in case the test fails).

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_composite_image():
114114
@cleanup
115115
def test_source_date_epoch():
116116
"""Test SOURCE_DATE_EPOCH support for PDF output"""
117-
_test_source_date_epoch("pdf", b"/CreationDate (D:20000101000000Z)")
117+
_test_source_date_epoch("pdf", b"/CreationDate (D:20001215101010Z)")
118118

119119

120120
@cleanup

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ def test_source_date_epoch():
181181
"""Test SOURCE_DATE_EPOCH support for PS output"""
182182
# SOURCE_DATE_EPOCH support is not tested with text.usetex,
183183
# because the produced timestamp comes from ghostscript:
184-
# %%CreationDate: D:20000101000000Z00\'00\', and this could change
184+
# %%CreationDate: D:20001215101010Z00\'00\', and this could change
185185
# with another ghostscript version.
186-
_test_source_date_epoch("ps", b"%%CreationDate: Sat Jan 1 00:00:00 2000")
186+
_test_source_date_epoch("ps", b"%%CreationDate: Fri Dec 15 10:10:10 2000")
187187

188188

189189
@cleanup

0 commit comments

Comments
 (0)