Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-04-09 09:09:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-04-09 09:09:12 +0300
commitc800ee6bfe602d1cdfafc042228add3692bdb12e (patch)
treea02dad89cb052cdd388791509696e6bbf94cf2ae /tests
parent79e862ad6b416968f3e0afa7a18f98ab11a4db03 (diff)
parent162e184ffd0f2e5f1584b95339df6cb3c429f017 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'tests')
-rw-r--r--tests/python/bl_pyapi_mathutils.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/python/bl_pyapi_mathutils.py b/tests/python/bl_pyapi_mathutils.py
index 7761b6cb7b1..9ca0376192a 100644
--- a/tests/python/bl_pyapi_mathutils.py
+++ b/tests/python/bl_pyapi_mathutils.py
@@ -260,6 +260,11 @@ class KDTreeTesting(unittest.TestCase):
k.balance()
return k
+ def assertAlmostEqualVector(self, first, second, places=7, msg=None, delta=None):
+ self.assertAlmostEqual(first[0], second[0], places=places, msg=msg, delta=delta)
+ self.assertAlmostEqual(first[1], second[1], places=places, msg=msg, delta=delta)
+ self.assertAlmostEqual(first[2], second[2], places=places, msg=msg, delta=delta)
+
def test_kdtree_single(self):
co = (0,) * 3
index = 2
@@ -360,12 +365,12 @@ class KDTreeTesting(unittest.TestCase):
ret_regular = k_odd.find(co)
self.assertEqual(ret_regular[1] % 2, 1)
ret_filter = k_all.find(co, lambda i: (i % 2) == 1)
- self.assertEqual(ret_regular, ret_filter)
+ self.assertAlmostEqualVector(ret_regular, ret_filter)
ret_regular = k_evn.find(co)
self.assertEqual(ret_regular[1] % 2, 0)
ret_filter = k_all.find(co, lambda i: (i % 2) == 0)
- self.assertEqual(ret_regular, ret_filter)
+ self.assertAlmostEqualVector(ret_regular, ret_filter)
# filter out all values (search odd tree for even values and the reverse)