[PATCH 14 of 18 helps-py3] test-filelog: move from dict() construction to {} literals

Augie Fackler raf at durin42.com
Wed Mar 12 12:40:48 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1394644862 14400
#      Wed Mar 12 13:21:02 2014 -0400
# Node ID 2761a791b113b84060b2df7bf25407f759293992
# Parent  6cb419dd3703ed59fc03c3996916e87a880a4f02
test-filelog: move from dict() construction to {} literals

The latter are both faster and more consistent across Python 2 and 3.

diff --git a/tests/test-filelog.py b/tests/test-filelog.py
--- a/tests/test-filelog.py
+++ b/tests/test-filelog.py
@@ -13,7 +13,7 @@
 def addrev(text, renamed=False):
     if renamed:
         # data doesn't matter. Just make sure filelog.renamed() returns True
-        meta = dict(copyrev=hex(nullid), copy='bar')
+        meta = {'copyrev': hex(nullid), 'copy': 'bar'}
     else:
         meta = {}
 


More information about the Mercurial-devel mailing list