approx(): Detect type errors earlier.
This commit is contained in:
@@ -441,6 +441,13 @@ class TestApprox(object):
|
||||
["*At index 0 diff: 3 != 4 * {}".format(expected), "=* 1 failed in *="]
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'x', [None, 'string', ['string'], [[1]], {'key': 'string'}, {'key': {'key': 1}}]
|
||||
)
|
||||
def test_expected_value_type_error(self, x):
|
||||
with pytest.raises(TypeError):
|
||||
approx(x)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"op",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user