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

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

Comments

Augie Fackler - March 12, 2014, 5:40 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1394644890 14400
#      Wed Mar 12 13:21:30 2014 -0400
# Node ID c69f62906358d91ef3a45ff561c2260540bd034e
# Parent  56b1f39dd0c11dbe8c6188fe3e248c5578073816
test-wireproto: 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-wireproto.py b/tests/test-wireproto.py
--- a/tests/test-wireproto.py
+++ b/tests/test-wireproto.py
@@ -18,7 +18,7 @@ 
     @wireproto.batchable
     def greet(self, name):
         f = wireproto.future()
-        yield wireproto.todict(name=mangle(name)), f
+        yield {'name': mangle(name)}, f
         yield unmangle(f.value)
 
 class serverrepo(object):