from viridis import tree
from six.moves import range

def test_split():
    t = tree.Ultrametric(list(range(6)))
    t.merge(0, 1, 0.1)
    t.merge(6, 2, 0.2)
    t.merge(3, 4, 0.3)
    t.merge(8, 5, 0.4)
    t.merge(7, 8, 0.5)
    t.split(0, 2)
    assert t.node[9]['num_leaves'] == 3
    t.split(0, 4) # nothing to do
    assert t.node[9]['num_leaves'] == 3

@@ -51,22 +51,52 @@
 ge%0A%0A
-def test_split
+import pytest%0A%0A@pytest.fixture%0Adef base_tree
 ():%0A
@@ -251,16 +251,76 @@
 8, 0.5)%0A
+    return t%0A%0A%0Adef test_split(base_tree):%0A    t = base_tree%0A
     t.sp

Update test to use pytest fixture