• Home
  • Raw
  • Download

Lines Matching +full:diff +full:- +full:sequences

159     * maxDiff: sets the maximum length of a diff in failure messages
254 """Returns a one-line description of the test, or None if no
382 function, args, kwargs = self._cleanups.pop(-1)
401 function, args, kwargs = self._cleanups.pop(-1)
545 if abs(first - second) <= delta:
555 if round(abs(second-first), places) == 0:
578 if not (first == second) and abs(first - second) > delta:
586 if not (first == second) and round(abs(second-first), places) != 0:
625 """An equality assertion for ordered sequences (like lists and tuples).
633 seq_type: The expected datatype of the sequences, or None if no
653 differing = 'First %s has no length. Non-sequence?' % (
660 differing = 'Second %s has no length. Non-sequence?' % (
698 # The sequences are the same, but have differing types.
703 'elements.\n' % (seq_type_name, len1 - len2))
712 'elements.\n' % (seq_type_name, len2 - len1))
727 def _truncateMessage(self, message, diff): argument
729 if max_diff is None or len(diff) <= max_diff:
730 return message + diff
731 return message + (DIFF_OMITTED % len(diff))
734 """A list-specific equality assertion.
746 """A tuple-specific equality assertion.
757 """A set-specific equality assertion.
832 diff = ('\n' + '\n'.join(difflib.ndiff(
835 standardMsg = self._truncateMessage(standardMsg, diff)
872 Asserts that each element has the same count in both sequences.
874 - [0, 1, 1] and [1, 0, 1] compare equal.
875 - [0, 0, 1] and [0, 1] compare unequal.
898 lines = ['First has %d, Second has %d: %r' % diff for diff in differences]
905 """Assert that two multi-line strings are equal."""
923 diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines))
924 standardMsg = self._truncateMessage(standardMsg, diff)
1022 This is useful for slipping pre-existing test functions into the
1023 unittest framework. Optionally, set-up and tidy-up functions can be
1024 supplied. As with TestCase, the tidy-up ('tearDown') function will
1025 always be called if the set-up ('setUp') function ran successfully.