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

Skip to content

Commit 541f97e

Browse files
author
Alexis Bienvenüe
committed
PEP8
1 parent 2e1c773 commit 541f97e

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

lib/matplotlib/testing/determinism.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def _test_determinism(objects='mhi', format="pdf"):
9292
for p in plots[1:]:
9393
assert_equal(p, plots[0])
9494

95+
9596
def _test_source_date_epoch(format, string):
9697
"""
9798
Test SOURCE_DATE_EPOCH support. Output a document with the envionment

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from matplotlib import cm, rcParams
1313
from matplotlib.backends.backend_pdf import PdfPages
1414
from matplotlib import pyplot as plt
15-
from matplotlib.testing.determinism import _test_source_date_epoch, _test_determinism
15+
from matplotlib.testing.determinism import (_test_source_date_epoch,
16+
_test_determinism)
1617
from matplotlib.testing.decorators import (image_comparison, knownfailureif,
1718
cleanup)
1819

@@ -91,8 +92,8 @@ def test_multipage_keep_empty():
9192

9293
@cleanup
9394
def test_composite_image():
94-
#Test that figures can be saved with and without combining multiple images
95-
#(on a single set of axes) into a single composite image.
95+
# Test that figures can be saved with and without combining multiple images
96+
# (on a single set of axes) into a single composite image.
9697
X, Y = np.meshgrid(np.arange(-5, 5, 1), np.arange(-5, 5, 1))
9798
Z = np.sin(Y ** 2)
9899
fig = plt.figure()
@@ -115,6 +116,7 @@ def test_source_date_epoch():
115116
"""Test SOURCE_DATE_EPOCH support for PDF output"""
116117
_test_source_date_epoch("pdf", b"/CreationDate (D:20000101000000Z)")
117118

119+
118120
@cleanup
119121
def test_determinism_plain():
120122
"""Test for reproducible PDF output: simple figure"""

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import matplotlib
1212
import matplotlib.pyplot as plt
1313
from matplotlib import patheffects
14-
from matplotlib.testing.determinism import _test_source_date_epoch, _test_determinism
14+
from matplotlib.testing.determinism import (_test_source_date_epoch,
15+
_test_determinism)
1516
from matplotlib.testing.decorators import cleanup, knownfailureif
1617

1718

@@ -161,7 +162,7 @@ def test_tilde_in_tempfilename():
161162
plt.rc('text', usetex=True)
162163
plt.plot([1, 2, 3, 4])
163164
plt.xlabel(r'\textbf{time} (s)')
164-
#matplotlib.verbose.set_level("debug")
165+
# matplotlib.verbose.set_level("debug")
165166
output_eps = os.path.join(base_tempdir, 'tex_demo.eps')
166167
# use the PS backend to write the file...
167168
plt.savefig(output_eps, format="ps")
@@ -174,20 +175,23 @@ def test_tilde_in_tempfilename():
174175
# do not break if this is not removeable...
175176
print(e)
176177

178+
177179
@cleanup
178180
def test_source_date_epoch():
179181
"""Test SOURCE_DATE_EPOCH support for PS output"""
182+
# SOURCE_DATE_EPOCH support is not tested with text.usetex,
183+
# because the produced timestamp comes from ghostscript:
184+
# %%CreationDate: D:20000101000000Z00\'00\', and this could change
185+
# with another ghostscript version.
180186
_test_source_date_epoch("ps", b"%%CreationDate: Sat Jan 1 00:00:00 2000")
181187

182-
# SOURCE_DATE_EPOCH support is not tested with text.usetex, because the produced
183-
# timestamp comes from ghostscript: %%CreationDate: D:20000101000000Z00\'00\',
184-
# and this could change with another ghostscript version.
185188

186189
@cleanup
187190
def test_determinism_all():
188191
"""Test for reproducible PS output"""
189192
_test_determinism(format="ps")
190193

194+
191195
@cleanup
192196
@needs_tex
193197
@needs_ghostscript
@@ -197,7 +201,6 @@ def test_determinism_all_tex():
197201
_test_determinism(format="ps")
198202

199203

200-
201204
if __name__ == '__main__':
202205
import nose
203206
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)