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

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


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

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

diff --git a/tests/test-url.py b/tests/test-url.py
--- a/tests/test-url.py
+++ b/tests/test-url.py
@@ -5,7 +5,7 @@
         print (a, b)
 
 def cert(cn):
-    return dict(subject=((('commonName', cn),),))
+    return {'subject': ((('commonName', cn),),)}
 
 from mercurial.sslutil import _verifycert
 


More information about the Mercurial-devel mailing list