def test_value_error(): with pytest.raises(TypeError): distance('aoeu', 1, 5, 4)
def test_order_of_points(): assert distance(-2.5, 2.5, 0.5, 6.5) == distance(0.5, 6.5, -2.5, 2.5)
def test_type_error(): with pytest.raises(TypeError): distance(None)
def test_horizontal_distance(): assert distance(0, 5, 10, 5) == 10
def test_mixed_coordinates(): assert distance(-2.5, 2.5, 0.5, 6.5) == 5 assert distance(2, 2, 7.5, 5) == 6.264982043070834
def test_negative_coordinates(): assert distance(-1, -1, -4, -5) == 5 assert distance(-10.1, -10.1, -5.1, -5.1) == 7.0710678118654755
def test_vertical_distance(): assert distance(3, 3, 3, 10) == 7 assert distance(-3, -3, -3, 3.5) == 6.5
def test_return_same_distance_when_poits_are_switched(): assert len.distance(3, 2, 4, 7) == len.distance(4, 7, 3, 2)
def test_zero_length(): assert distance(0, 0, 0, 0) == 0 assert distance(-5, -5, -5, -5) == 0 assert distance(1.5, 1.5, 1.5, 1.5) == 0
def test_return_proper_distance_for_horizontal_distance(): assert len.distance(2, 0, 7, 0) == 5
def test_return_proper_distance_for_typical_coordinates(): assert len.distance(2, 5, 5, 9) == 5
def test_return_proper_distance_for_vertical_distance(): assert len.distance(0, 2, 0, 7) == 5
def test_returns_proper_distance_for_negative_coordinates(): assert len.distance(-6, -2, -8, -2) == 2
def test_returns_0_for_the_same_point(): assert len.distance(3, 3, 3, 3) == 0
def test_raises_value_error_when_called_on_aoeu(): with pytest.raises(ValueError): len.distance("aoeu", 2, 2, 2)
def test_raises_type_error_when_called_on_None(): with pytest.raises(TypeError): len.distance(None)