コード例 #1
0
def test_point_distance():
    p1 = Point()
    p2 = Point(2, 4)

    assert p1.distance(p2) == 4.47213595499958
コード例 #2
0
def test_point_distance_exception():
    with pytest.raises(TypeError):
        p1 = Point()
        p1.distance(dir)
コード例 #3
0
ファイル: test_point.py プロジェクト: OrLove101/w5.22.05.2021
def test_distance():
    p1 = Point()
    p2 = Point(2.0, 4.0)

    assert p1.distance(p2) == 3.1622776601683795