Show More
@@ -918,7 +918,7 b' def _counter_pprint(obj, p, cycle):' | |||||
918 | if cycle: |
|
918 | if cycle: | |
919 | p.pretty(cls_ctor(RawText("..."))) |
|
919 | p.pretty(cls_ctor(RawText("..."))) | |
920 | elif len(obj): |
|
920 | elif len(obj): | |
921 | p.pretty(cls_ctor(dict(obj))) |
|
921 | p.pretty(cls_ctor(dict(sorted(obj.items(), key=lambda x: x[1], reverse=True)))) | |
922 | else: |
|
922 | else: | |
923 | p.pretty(cls_ctor()) |
|
923 | p.pretty(cls_ctor()) | |
924 |
|
924 |
@@ -422,6 +422,7 b' def test_collections_counter():' | |||||
422 | (Counter(), 'Counter()'), |
|
422 | (Counter(), 'Counter()'), | |
423 | (Counter(a=1), "Counter({'a': 1})"), |
|
423 | (Counter(a=1), "Counter({'a': 1})"), | |
424 | (MyCounter(a=1), "MyCounter({'a': 1})"), |
|
424 | (MyCounter(a=1), "MyCounter({'a': 1})"), | |
|
425 | (Counter(a=1, c=22), "Counter({'c': 22, 'a': 1})") | |||
425 | ] |
|
426 | ] | |
426 | for obj, expected in cases: |
|
427 | for obj, expected in cases: | |
427 | assert pretty.pretty(obj) == expected |
|
428 | assert pretty.pretty(obj) == expected |
General Comments 0
You need to be logged in to leave comments.
Login now