def atestrunner_countIndependentLosses():
    # DEPRECATED. Use pytest.
    passed = []

    for i, (a, dat) in enumerate(zip(answers, data), start=1):
        result = countIndependentLosses(dat, dat.root, phyltree)

        if result == a:
            passed.append(1)
        else:
            passed.append(0)
            print('# %d. FAILED: %s (expected %s)' % (i, result, a),
                  file=stderr)

    print('Passed %d/%d tests: [%s]' %
          (sum(passed), i, ' '.join(str(x) for x in passed)))

    return sum(passed) == i
 def test_data7_2species_1basaldup_2del(self):
     assert countIndependentLosses(data[7], data[7].root,
                                   phyltree) == answers[7]
 def test_data6_3species_1basaldup_2postbasaldel(self):
     assert countIndependentLosses(data[6], data[6].root,
                                   phyltree) == answers[6]
 def test_data5(self):
     assert countIndependentLosses(data[5], data[5].root,
                                   phyltree) == answers[5]
 def test_data1_2species_1basaldup(self):
     assert countIndependentLosses(data[1], data[1].root,
                                   phyltree) == answers[1]
 def test_data0_1species_1dup(self):
     assert countIndependentLosses(data[0], data[0].root,
                                   phyltree) == answers[0]