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

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2014, 5:40 p.m.
Message ID <2761a791b113b84060b2.1394646048@augie-macbookair>
Download mbox | patch
Permalink /patch/3927/
State Accepted
Commit 2761a791b113b84060b2df7bf25407f759293992
Headers show

Comments

Augie Fackler - March 12, 2014, 5:40 p.m.
# HG changeset patch
# User Augie Fackler <raf@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.

Patch

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 = {}