changeset 34154:be00af4a1ac5

doctest: coerce dict.keys() to list Otherwise it would be printed as odict_keys([...]) on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:33:10 +0900
parents 0f9936d80e01
children 52ec9ac0303b
files mercurial/templater.py mercurial/util.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Sun Sep 03 15:16:01 2017 +0900
+++ b/mercurial/templater.py	Sun Sep 03 17:33:10 2017 +0900
@@ -489,10 +489,10 @@
     ...     x = _parseexpr(expr)
     ...     n = getsymbol(x[1])
     ...     return _buildfuncargs(x[2], context, exprmethods, n, argspec)
-    >>> fargs(b'a(l=1, k=2)', b'k l m').keys()
+    >>> list(fargs(b'a(l=1, k=2)', b'k l m').keys())
     ['l', 'k']
     >>> args = fargs(b'a(opts=1, k=2)', b'**opts')
-    >>> args.keys(), args[b'opts'].keys()
+    >>> list(args.keys()), list(args[b'opts'].keys())
     (['opts'], ['opts', 'k'])
     """
     def compiledict(xs):
--- a/mercurial/util.py	Sun Sep 03 15:16:01 2017 +0900
+++ b/mercurial/util.py	Sun Sep 03 17:33:10 2017 +0900
@@ -584,7 +584,7 @@
     >>> d2
     sortdict([('a', 0), ('b', 1)])
     >>> d2.update([(b'a', 2)])
-    >>> d2.keys() # should still be in last-set order
+    >>> list(d2.keys()) # should still be in last-set order
     ['b', 'a']
     '''