From 3b409f885acac8dca2082af003e64904b5be1272 Mon Sep 17 00:00:00 2001 From: Adrian Altenhoff Date: Mon, 18 Nov 2024 16:39:04 +0100 Subject: [PATCH] tests for equal does not always work with random mutations -> lessEqual --- test/test_computeLRF.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_computeLRF.py b/test/test_computeLRF.py index 06e80fe..6576dae 100644 --- a/test/test_computeLRF.py +++ b/test/test_computeLRF.py @@ -17,19 +17,19 @@ def test_computeLRF1(self): # introduce 3 random edits and compute the distance t2 = mutateLabeledTree(self.t1, 3) res = computeLRF(self.t1,t2) - self.assertEqual(res,3) + self.assertLessEqual(res,3) # introduce 5 random edits and compute the distance t2 = mutateLabeledTree(self.t1, 5) res = computeLRF(self.t1,t2) - self.assertEqual(res,5) + self.assertLessEqual(res,5) def test_computeLRF2(self): # randomise the labels and compute the distance t3 = randomLabels(self.t1) t4 = mutateLabeledTree(t3, 5) res = computeLRF(t3,t4) - self.assertEqual(res,5) + self.assertLessEqual(res,5) class ErrorTests(unittest.TestCase): @@ -47,5 +47,6 @@ def test_raises_invalid_argument_types(self): with self.assertRaises(ValueError): computeLRF('((A,B),C);', '(A,(B,C));') + if __name__ == '__main__': unittest.main()