我应该如何为float的元组列表编写pytest断言?例如,使用python 3.6.7和pytest 3.3.2
assert [(1.5, 1.5)] == pytest.approx([(1.5, 1.5)])
成功,但是
assert [(1.0, 2.0)] == pytest.approx([(1.5, 1.5)])
抛出一个TypeError: bad operand type for abs(): 'tuple'
。这是pytest中的错误还是我在滥用pytest.approx()
函数?