예제 #1
0
def test_conversion_type_error(source, target):
    with pytest.raises(TypeError):
        conversion_factor(source, target)
예제 #2
0
def test_conversion_invalid_units():
    with pytest.raises(ValueError):
        conversion_factor(25, 6)
예제 #3
0
def test_conversion_factor(source, target, factor):
    assert conversion_factor(source, target) == pytest.approx(factor)