Home | History | Annotate | Download | only in python2.7

Lines Matching refs:got

272 def _ellipsis_match(want, got):
279 return want == got
286 startpos, endpos = 0, len(got)
289 if got.startswith(w):
296 if got.endswith(w):
314 startpos = got.find(w, startpos, endpos)
903 # <= 2.3 that got lost by accident in 2.4. It was repaired in
1189 def report_success(self, out, test, example, got):
1197 def report_failure(self, out, test, example, got):
1202 self._checker.output_difference(example, got, self.optionflags))
1298 got = self._fakeout.getvalue() # the actual output
1305 if check(example.want, got, self.optionflags):
1313 got += _exception_traceback(exc_info)
1335 self.report_success(out, test, example, got)
1338 self.report_failure(out, test, example, got)
1519 def check_output(self, want, got, optionflags):
1521 Return True iff the actual output from an example (`got`)
1531 if got == want:
1537 if (got,want) == ("True\n", "1\n"):
1539 if (got,want) == ("False\n", "0\n"):
1548 # If a line in got contains only spaces, then remove the
1550 got = re.sub('(?m)^\s*?$', '', got)
1551 if got == want:
1558 got = ' '.join(got.split())
1560 if got == want:
1564 # match any substring in `got`.
1566 if _ellipsis_match(want, got):
1573 def _do_a_fancy_diff(self, want, got, optionflags):
1594 return want.count('\n') > 2 and got.count('\n') > 2
1596 def output_difference(self, example, got, optionflags):
1600 output (`got`). `optionflags` is the set of option flags used
1601 to compare `want` and `got`.
1607 got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got)
1610 if self._do_a_fancy_diff(want, got, optionflags):
1611 # Split want & got into lines.
1613 got_lines = got.splitlines(True)
1635 if want and got:
1636 return 'Expected:\n%sGot:\n%s' % (_indent(want), _indent(got))
1639 elif got:
1640 return 'Expected nothing\nGot:\n%s' % _indent(got)
1653 - got: the actual output
1655 def __init__(self, test, example, got):
1658 self.got = got
1736 >>> failure.got
1782 def report_failure(self, out, test, example, got):
1783 raise DocTestFailure(test, example, got)
2276 >>> failure.got