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

Skip to content

Commit fa87fa7

Browse files
committed
TST : tweak test_add_collection
This is needed because this test tries to add artists from one axes to another which is not really supported. Not 100% that this is fully equivalent to the current test. There is a call to `add_collection` in scatter, but the test might be defeated by some of the other logic in scatter.
1 parent edd4f86 commit fa87fa7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/tests/test_collections.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,12 @@ def test_null_collection_datalim():
407407
def test_add_collection():
408408
# Test if data limits are unchanged by adding an empty collection.
409409
# Github issue #1490, pull #1497.
410-
ax = plt.axes()
411410
plt.figure()
412-
ax2 = plt.axes()
413-
coll = ax2.scatter([0, 1], [0, 1])
411+
ax = plt.axes()
412+
coll = ax.scatter([0, 1], [0, 1])
414413
ax.add_collection(coll)
415414
bounds = ax.dataLim.bounds
416-
coll = ax2.scatter([], [])
417-
ax.add_collection(coll)
415+
coll = ax.scatter([], [])
418416
assert_equal(ax.dataLim.bounds, bounds)
419417

420418

0 commit comments

Comments
 (0)