drop the duplicate approx call

update test to include both np.array(actual) and np.array(expected)
This commit is contained in:
abrammer
2018-07-24 21:18:44 -04:00
parent 514ca6f4ad
commit f0db64ac2e
2 changed files with 11 additions and 5 deletions

View File

@@ -211,10 +211,9 @@ class ApproxScalar(ApproxBase):
the pre-specified tolerance.
"""
if _is_numpy_array(actual):
return (
ApproxNumpy(actual, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
== self.expected
)
import numpy as np
return np.all(abs(self.expected - actual) <= self.tolerance)
# Short-circuit exact equality.
if actual == self.expected: