10000 TST: add some tests · matplotlib/matplotlib@982616c · GitHub
[go: up one dir, main page]

Skip to content

Commit 982616c

Browse files
committed
TST: add some tests
1 parent 1376c96 commit 982616c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/matplotlib/tests/test_contour.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,14 @@ def test_contourf_log_extension():
398398
c3 = ax3.contourf(data, levels=levels,
399399
norm=LogNorm(vmin=levels.min(), vmax=levels.max()),
400400
extend='both')
401-
plt.colorbar(c1, ax=ax1)
402-
plt.colorbar(c2, ax=ax2)
403-
plt.colorbar(c3, ax=ax3)
401+
cb = plt.colorbar(c1, ax=ax1)
402+
assert cb.ax.get_ylim() == (1e-8, 1e10)
403+
cb = plt.colorbar(c2, ax=ax2)
404+
assert cb.ax.get_ylim() == (1e-4, 1e6)
405+
cb = plt.colorbar(c3, ax=ax3)
406+
print(cb.ax.get_ylim())
407+
assert_array_almost_equal(cb.ax.get_ylim(),
408+
[3.162277660168379e-05, 3162277.660168383], 2)
404409

405410

406411
@image_comparison(baseline_images=['contour_addlines'],
@@ -414,3 +419,4 @@ def test_contour_addlines():
414419
cont = ax.contour(X+1000)
415420
cb = fig.colorbar(pcm)
416421
cb.add_lines(cont)
422+
assert_array_almost_equal(cb.ax.get_ylim(), [114.3091, 9972.30735], 3)

0 commit comments

Comments
 (0)
0