From 409faad85aff2732365c3395a6b22c43d3a82628 Mon Sep 17 00:00:00 2001 From: Victor LEUNG Date: Fri, 26 Apr 2024 13:32:18 +0800 Subject: [PATCH] ipy fix --- tests/compas/geometry/test_curves_line.py | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/compas/geometry/test_curves_line.py b/tests/compas/geometry/test_curves_line.py index 9d2ec670b3e..357f282388f 100644 --- a/tests/compas/geometry/test_curves_line.py +++ b/tests/compas/geometry/test_curves_line.py @@ -251,20 +251,18 @@ def test_line_point_from_start(p1, p2): ([-11.1, 22.2, 33.3], [1.1, -2.2, -3.3]), ], ) -@pytest.mark.parametrize( - "distance", - [0, 1, 4, -9, 3.3, 0.00001, -0.00001], -) def test_line_point_from_end(p1, p2, distance): - line = Line(p1, p2) - point = line.point_from_end(distance) - distance_to_start = distance_point_point(point, p1) - distance_to_end = distance_point_point(point, p2) - # Check that the distance is correct - assert TOL.is_close(distance_to_end, abs(distance)) - # Check that negative distance gives a point far away from start - if distance < 0: - assert distance_to_start > line.length + distances = [0, 1, 4, -9, 3.3, 0.00001, -0.00001] + for distance in distances: + line = Line(p1, p2) + point = line.point_from_end(distance) + distance_to_start = distance_point_point(point, p1) + distance_to_end = distance_point_point(point, p2) + # Check that the distance is correct + assert TOL.is_close(distance_to_end, abs(distance)) + # Check that negative distance gives a point far away from start + if distance < 0: + assert distance_to_start > line.length @pytest.mark.parametrize(