def __repr__(self):
if isinstance(self.expected, complex):<EOL><INDENT>return str(self.expected)<EOL><DEDENT>if math.isinf(self.expected):<EOL><INDENT>return str(self.expected)<EOL><DEDENT>try:<EOL><INDENT>vetted_tolerance = "<STR_LIT>".format(self.tolerance)<EOL><DEDENT>except ValueError:<EOL><INDENT>vetted_tolerance = "<STR_LIT>"<EOL><DEDENT>if sys.version_info[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>return "<STR_LIT>".format(self.expected, vetted_tolerance)<EOL><DEDENT>else:<EOL><INDENT>return u"<STR_LIT>".format(self.expected, vetted_tolerance)<EOL><DEDENT>
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).