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

Skip to content

Commit 317491e

Browse files
committed
Move markevery unit tests into regression testing framework
1 parent 341f62f commit 317491e

8 files changed

Lines changed: 1385 additions & 25 deletions

File tree

14.1 KB
Binary file not shown.
34.6 KB
Loading

lib/matplotlib/tests/baseline_images/test_axes/markevery.svg

Lines changed: 609 additions & 0 deletions
Loading
Binary file not shown.
253 KB
Loading

lib/matplotlib/tests/baseline_images/test_axes/markevery_line.svg

Lines changed: 749 additions & 0 deletions
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,33 @@ def test_units_strings():
570570
ax.plot(Id, pout)
571571
fig.savefig('units_strings')
572572

573+
@image_comparison(baseline_images=['markevery'])
574+
def test_markevery():
575+
x, y = np.random.rand(2, 100)
576+
577+
# check marker only plot
578+
fig = plt.figure()
579+
ax = fig.add_subplot(111)
580+
ax.plot(x, y, 'o', label='default')
581+
ax.plot(x, y, 'd', markevery=None, label='mark all')
582+
ax.plot(x, y, 's', markevery=10, label='mark every 10')
583+
ax.plot(x, y, '+', markevery=(5, 20), label='mark every 5 starting at 10')
584+
ax.legend()
585+
fig.savefig('markevery')
586+
587+
@image_comparison(baseline_images=['markevery_line'])
588+
def test_markevery_line():
589+
x, y = np.random.rand(2, 100)
590+
# check line/marker combos
591+
fig = plt.figure()
592+
ax = fig.add_subplot(111)
593+
ax.plot(x, y, '-o', label='default')
594+
ax.plot(x, y, '-d', markevery=None, label='mark all')
595+
ax.plot(x, y, '-s', markevery=10, label='mark every 10')
596+
ax.plot(x, y, '-+', markevery=(5, 20), label='mark every 5 starting at 10')
597+
ax.legend()
598+
fig.savefig('markevery_line')
599+
573600
if __name__=='__main__':
574601
import nose
575602
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

unit/nose_tests.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,6 @@ def test_create_subplot_object():
1515
fig.add_subplot(ax)
1616
plt.close(fig)
1717

18-
def test_markevery():
19-
x, y = np.random.rand(2, 100)
20-
21-
# check marker only plot
22-
fig = plt.figure()
23-
ax = fig.add_subplot(111)
24-
ax.plot(x, y, 'o', label='default')
25-
ax.plot(x, y, 'd', markevery=None, label='mark all')
26-
ax.plot(x, y, 's', markevery=10, label='mark every 10')
27-
ax.plot(x, y, '+', markevery=(5, 20), label='mark every 5 starting at 10')
28-
ax.legend()
29-
fig.canvas.draw()
30-
plt.close(fig)
31-
32-
# check line/marker combos
33-
fig = plt.figure()
34-
ax = fig.add_subplot(111)
35-
ax.plot(x, y, '-o', label='default')
36-
ax.plot(x, y, '-d', markevery=None, label='mark all')
37-
ax.plot(x, y, '-s', markevery=10, label='mark every 10')
38-
ax.plot(x, y, '-+', markevery=(5, 20), label='mark every 5 starting at 10')
39-
ax.legend()
40-
fig.canvas.draw()
41-
plt.close(fig)
42-
4318
if __name__=='__main__':
4419
nose.runmodule(argv=['-s','--with-doctest'], exit=False)
4520

0 commit comments

Comments
 (0)