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

Skip to content

Commit 6e494b8

Browse files
committed
test conversion: move old-style test to new-style test
svn path=/trunk/matplotlib/; revision=7695
1 parent f3144f3 commit 6e494b8

3 files changed

Lines changed: 22 additions & 64 deletions

File tree

test/test_plots/baseline/TestSpan/axhspan_epoch.png renamed to lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png

File renamed without changes.

lib/matplotlib/tests/test_axes.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,25 @@ def test_axvspan_epoch():
334334
ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt )
335335

336336
fig.savefig( 'axvspan_epoch' )
337+
338+
@image_comparison(baseline_images=['axhspan_epoch'])
339+
def test_axhspan_epoch():
340+
"""Test the axhspan method with Epochs."""
341+
from datetime import datetime
342+
import matplotlib.testing.jpl_units as units
343+
units.register()
344+
345+
# generate some data
346+
t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) )
347+
tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) )
348+
349+
dt = units.Duration( "ET", units.day.convert( "sec" ) )
350+
351+
fig = pylab.figure()
352+
353+
pylab.axhspan( t0, tf, facecolor="blue", alpha=0.25 )
354+
355+
ax = pylab.gca()
356+
ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt )
357+
358+
fig.savefig( 'axhspan_epoch' )

test/test_plots/TestSpan.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)