Skip to content

Commit e0aad47

Browse files
committed
Improve test
1 parent fc27485 commit e0aad47

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source-code/testing/Hypothesis/points.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ def test_distance():
4646
assert math.isclose(p1.distance(p2), 5.0)
4747

4848

49-
@given(x1=st.floats(), y1=st.floats(), x2=st.floats(), y2=st.floats(), x=st.floats(), y=st.floats())
50-
def test_is_on_line(x1: float, y1: float, x2: float, y2: float, x: float, y: float):
49+
@given(x1=st.floats(), y1=st.floats(), x2=st.floats(), y2=st.floats())
50+
def test_is_on_line(x1: float, y1: float, x2: float, y2: float):
5151
p1 = Point(x1, y1)
5252
p2 = Point(x2, y2)
53-
p = Point(x, y)
53+
p = Point((x1 + x2)/2, (y1 + y2)/2)
5454
assert p.is_on_line(p1, p2)
55+
assert p1.is_on_line(p1, p2)
56+
assert p2.is_on_line(p1, p2)

0 commit comments

Comments
 (0)