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>2021-06-07 08:31:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-07 17:07:19 +0300
commit7ca5ba14b5638eeff93d00996c00cb153a35d062 (patch)
tree1345eb1e760f4c960473490d9189140d394a746a /tests
parent51bf1680bd114cd1886f301681aa3708145a2880 (diff)
Cleanup: use keywords for unit tests
Prepare for function calls to be keyword only.
Diffstat (limited to 'tests')
-rw-r--r--tests/python/bl_pyapi_bpy_utils_units.py4
-rw-r--r--tests/python/bl_pyapi_mathutils.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/python/bl_pyapi_bpy_utils_units.py b/tests/python/bl_pyapi_bpy_utils_units.py
index d5d9c9c707b..bdb64fc361e 100644
--- a/tests/python/bl_pyapi_bpy_utils_units.py
+++ b/tests/python/bl_pyapi_bpy_utils_units.py
@@ -54,7 +54,7 @@ class UnitsTesting(unittest.TestCase):
return ((abs(v1 - v2) / max(abs(v1), abs(v2))) <= e)
for usys, utype, ref, inpt, val in self.INPUT_TESTS:
- opt_val = units.to_value(usys, utype, inpt, ref)
+ opt_val = units.to_value(usys, utype, inpt, str_ref_unit=ref)
# Note: almostequal is not good here, precision is fixed on decimal digits, not variable with
# magnitude of numbers (i.e. 1609.4416 ~= 1609.4456 fails even at 5 of 'places'...).
self.assertTrue(similar_values(opt_val, val, 1e-7),
@@ -63,7 +63,7 @@ class UnitsTesting(unittest.TestCase):
def test_units_outputs(self):
for usys, utype, prec, sep, compat, val, output in self.OUTPUT_TESTS:
- opt_str = units.to_string(usys, utype, val, prec, sep, compat)
+ opt_str = units.to_string(usys, utype, val, precision=prec, split_unit=sep, compatible_unit=compat)
self.assertEqual(
opt_str, output,
msg=(
diff --git a/tests/python/bl_pyapi_mathutils.py b/tests/python/bl_pyapi_mathutils.py
index 914b1689a5c..c3a22be421a 100644
--- a/tests/python/bl_pyapi_mathutils.py
+++ b/tests/python/bl_pyapi_mathutils.py
@@ -463,20 +463,20 @@ 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)
+ ret_filter = k_all.find(co, filter=lambda i: (i % 2) == 1)
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)
+ ret_filter = k_all.find(co, filter=lambda i: (i % 2) == 0)
self.assertAlmostEqualVector(ret_regular, ret_filter)
# filter out all values (search odd tree for even values and the reverse)
co = (0,) * 3
- ret_filter = k_odd.find(co, lambda i: (i % 2) == 0)
+ ret_filter = k_odd.find(co, filter=lambda i: (i % 2) == 0)
self.assertEqual(ret_filter[1], None)
- ret_filter = k_evn.find(co, lambda i: (i % 2) == 1)
+ ret_filter = k_evn.find(co, filter=lambda i: (i % 2) == 1)
self.assertEqual(ret_filter[1], None)
def test_kdtree_invalid_size(self):