Skip to content

Commit 4fbde3d

Browse files
test scatter changes
1 parent 278cbb7 commit 4fbde3d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/test_cleanfigure.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,18 @@ def test_scatter(self):
405405
ax.scatter(x, y)
406406
ax.set_ylim([20, 80])
407407
ax.set_xlim([20, 80])
408-
with pytest.warns(Warning):
409-
cleanfigure.clean_figure(fig)
408+
raw = get_tikz_code()
409+
410+
cleanfigure.clean_figure()
411+
clean = get_tikz_code()
412+
413+
# Use number of lines to test if it worked.
414+
# the baseline (raw) should have 20 points
415+
# the clean version (clean) should have 2 points
416+
# the difference in line numbers should therefore be 2
417+
numLinesRaw = raw.count("\n")
418+
numLinesClean = clean.count("\n")
419+
assert numLinesRaw - numLinesClean == 6
410420
plt.close("all")
411421

412422
def test_bar(self):

0 commit comments

Comments
 (0)