diff options
author | Matthew Duck <matt@mattduck.com> | 2016-09-19 12:17:26 +0100 |
---|---|---|
committer | Matthew Duck <matt@mattduck.com> | 2016-09-19 15:27:28 +0100 |
commit | dd64d823b90f87fca2bb77a61da0912d91f8d7ea (patch) | |
tree | c96766ad4ef3b475218312e9422c63e7b36e01c8 /_pytest/assertion | |
parent | dc16fe2bb9572177cf8b66a814c463feaf52e85b (diff) | |
download | pytest-dd64d823b90f87fca2bb77a61da0912d91f8d7ea.tar.gz |
Don't display dict common items if verbosity=1
Part one of https://github.com/pytest-dev/pytest/issues/1512.
If verbosity=1, assertion explanations are truncated at 10 lines. In this
situation, it's more important to tell the user which dictionary items are
different than which are the same.
Diffstat (limited to '_pytest/assertion')
-rw-r--r-- | _pytest/assertion/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/_pytest/assertion/util.py b/_pytest/assertion/util.py index 29ae51186..709fe3b4d 100644 --- a/_pytest/assertion/util.py +++ b/_pytest/assertion/util.py @@ -256,8 +256,8 @@ def _compare_eq_dict(left, right, verbose=False): explanation = [] common = set(left).intersection(set(right)) same = dict((k, left[k]) for k in common if left[k] == right[k]) - if same and not verbose: - explanation += [u('Omitting %s identical items, use -v to show') % + if same and verbose < 2: + explanation += [u('Omitting %s identical items, use -vv to show') % len(same)] elif same: explanation += [u('Common items:')] |