def test_best_rational_approximation_raise(self, v): with pytest.raises(NoApproximationError, match="Couldn't find approximation."): best_rational_approximation(v)
def test_best_rational_approximation(self, v, n, d): assert best_rational_approximation(v) == {"n": n, "d": d}