Fix lint flagged by pre-commit
This commit is contained in:
parent
011706e462
commit
50d839c782
|
@ -444,10 +444,10 @@ class ApproxScalar(ApproxBase):
|
||||||
# NB: we need Complex, rather than just Number, to ensure that __abs__,
|
# NB: we need Complex, rather than just Number, to ensure that __abs__,
|
||||||
# __sub__, and __float__ are defined. Also, consider bool to be
|
# __sub__, and __float__ are defined. Also, consider bool to be
|
||||||
# nonnumeric, even though it has the required arithmetic.
|
# nonnumeric, even though it has the required arithmetic.
|
||||||
if not (
|
if isinstance(self.expected, bool) or not (
|
||||||
isinstance(self.expected, (Complex, Decimal))
|
isinstance(self.expected, (Complex, Decimal))
|
||||||
and isinstance(actual, (Complex, Decimal))
|
and isinstance(actual, (Complex, Decimal))
|
||||||
) or isinstance(self.expected, bool):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Allow the user to control whether NaNs are considered equal to each
|
# Allow the user to control whether NaNs are considered equal to each
|
||||||
|
|
|
@ -559,11 +559,11 @@ class TestApprox:
|
||||||
assert approx(x, rel=5e-6, abs=0) == a
|
assert approx(x, rel=5e-6, abs=0) == a
|
||||||
assert approx(x, rel=5e-7, abs=0) != a
|
assert approx(x, rel=5e-7, abs=0) != a
|
||||||
|
|
||||||
def test_bool(self):
|
def test_expecting_bool(self):
|
||||||
assert True == approx(True)
|
assert True == approx(True) # noqa: E712
|
||||||
assert False == approx(False)
|
assert False == approx(False) # noqa: E712
|
||||||
assert True != approx(False)
|
assert True != approx(False) # noqa: E712
|
||||||
assert True != approx(False, abs=2)
|
assert True != approx(False, abs=2) # noqa: E712
|
||||||
assert 1 != approx(True)
|
assert 1 != approx(True)
|
||||||
|
|
||||||
def test_list(self):
|
def test_list(self):
|
||||||
|
|
Loading…
Reference in New Issue