class_docstr: Perform approximate comparisons where the expected value is a single number.
class_docstr_tok: ["Perform","approximate","comparisons","where","the","expected","value","is","a","single","number","."]
docstr: Return true if the given value is equal to the expected value within
  the pre-specified tolerance.
code: def __eq__(self, actual):
      """
      Return true if the given value is equal to the expected value within
      the pre-specified tolerance.
      """
      if _is_numpy_array(actual):
          # Call ``__eq__()`` manually to prevent infinite-recursion with
          # numpy<1.13.  See #3748.
          return all(self.__eq__(a) for a in actual.flat)
  
      # Short-circuit exact equality.
      if actual == self.expected:
          return True
  
      # Allow the user to control whether NaNs are considered equal to each
      # other or not.  The abs() calls are for compatibility with complex
      # numbers.
      if math.isnan(abs(self.expected)):
          return self.nan_ok and math.isnan(abs(actual))
  
      # Infinity shouldn't be approximately equal to anything but itself, but
      # if there's a relative tolerance, it will be infinite and infinity
      # will seem approximately equal to everything.  The equal-to-itself
      # case would have been short circuited above, so here we can just
      # return false if the expected value is infinite.  The abs() call is
      # for compatibility with complex numbers.
      if math.isinf(abs(self.expected)):
          return False
  
      # Return true if the two numbers are within the tolerance.
      return abs(self.expected - actual) <= self.tolerance
  
imports: from __future__ import absolute_import
  import math
  import pprint
  import sys
  import warnings
  from decimal import Decimal
  from numbers import Number
  from more_itertools.more import always_iterable
  from six.moves import filterfalse
  from six.moves import zip
  import _pytest._code
  from _pytest import deprecated
  from _pytest.compat import isclass
  from _pytest.compat import Iterable
  from _pytest.compat import Mapping
  from _pytest.compat import Sized
  from _pytest.compat import STRING_TYPES
  from _pytest.outcomes import fail
label_desc: Use image node_id 2 for calling the ApproxScalar obj's underlying member method code with example usage: obj.__eq__(actual) and returns: unknown, all, True, unknown, False