If two named tuples are equal, they can be asserted in pytest like this:
assert tuple_under_test == expected_tuple
I want to do the same for named tuples containing floats. The catch is that these float values need to be rounded for proper comparison. Is there something similar to pytest.approx for named tuples?
assert tuple_under_test == compare_approx(Tuple(
FloatValue=2.2
FloatValue=2.3
), rel=0.1)