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 a string communicating both the expected value and the tolerance
  for the comparison being made, e.g. '1.0 +- 1e-6'.  Use the unicode
  plus/minus symbol if this is python3 (it's too hard to get right for
  python2).
code: def __repr__(self):
      """
      Return a string communicating both the expected value and the tolerance
      for the comparison being made, e.g. '1.0 +- 1e-6'.  Use the unicode
      plus/minus symbol if this is python3 (it's too hard to get right for
      python2).
      """
      if isinstance(self.expected, complex):
          return str(self.expected)
  
      # Infinities aren't compared using tolerances, so don't show a
      # tolerance.
      if math.isinf(self.expected):
          return str(self.expected)
  
      # If a sensible tolerance can't be calculated, self.tolerance will
      # raise a ValueError.  In this case, display '???'.
      try:
          vetted_tolerance = "{:.1e}".format(self.tolerance)
      except ValueError:
          vetted_tolerance = "???"
  
      if sys.version_info[0] == 2:
          return "{} +- {}".format(self.expected, vetted_tolerance)
      else:
          return "{} \u00b1 {}".format(self.expected, vetted_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 1 for calling the ApproxScalar obj's underlying member method code with example usage: obj.__repr__() and returns: str, str, str, str