Skip to content

Commit 409faad

Browse files
committed
ipy fix
1 parent 9e1945d commit 409faad

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tests/compas/geometry/test_curves_line.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -251,20 +251,18 @@ def test_line_point_from_start(p1, p2):
251251
([-11.1, 22.2, 33.3], [1.1, -2.2, -3.3]),
252252
],
253253
)
254-
@pytest.mark.parametrize(
255-
"distance",
256-
[0, 1, 4, -9, 3.3, 0.00001, -0.00001],
257-
)
258254
def test_line_point_from_end(p1, p2, distance):
259-
line = Line(p1, p2)
260-
point = line.point_from_end(distance)
261-
distance_to_start = distance_point_point(point, p1)
262-
distance_to_end = distance_point_point(point, p2)
263-
# Check that the distance is correct
264-
assert TOL.is_close(distance_to_end, abs(distance))
265-
# Check that negative distance gives a point far away from start
266-
if distance < 0:
267-
assert distance_to_start > line.length
255+
distances = [0, 1, 4, -9, 3.3, 0.00001, -0.00001]
256+
for distance in distances:
257+
line = Line(p1, p2)
258+
point = line.point_from_end(distance)
259+
distance_to_start = distance_point_point(point, p1)
260+
distance_to_end = distance_point_point(point, p2)
261+
# Check that the distance is correct
262+
assert TOL.is_close(distance_to_end, abs(distance))
263+
# Check that negative distance gives a point far away from start
264+
if distance < 0:
265+
assert distance_to_start > line.length
268266

269267

270268
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)