Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_struct.py @ 31515:71a294bd7950 legacy-trunk
Replace backticks with repr() or "%r"
From SF patch #852334.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Thu, 12 Feb 2004 17:35:32 +0000 |
| parents | 9f287e5eb037 |
| children | 32df1d05cb2d |
line wrap: on
line diff
--- a/Lib/test/test_struct.py Thu Feb 12 15:28:27 2004 +0000 +++ b/Lib/test/test_struct.py Thu Feb 12 17:35:32 2004 +0000 @@ -48,8 +48,8 @@ sz = struct.calcsize(fmt) sz3 = struct.calcsize(fmt3) if sz * 3 != sz3: - raise TestFailed, 'inconsistent sizes (3*%s -> 3*%d = %d, %s -> %d)' % ( - `fmt`, sz, 3*sz, `fmt3`, sz3) + raise TestFailed, 'inconsistent sizes (3*%r -> 3*%d = %d, %r -> %d)' % ( + fmt, sz, 3*sz, fmt3, sz3) simple_err(struct.pack, 'iii', 3) simple_err(struct.pack, 'i', 3, 3, 3) @@ -120,21 +120,21 @@ for fmt, arg, big, lil, asy in tests: if verbose: - print `fmt`, `arg`, `big`, `lil` + print "%r %r %r %r" % (fmt, arg, big, lil) for (xfmt, exp) in [('>'+fmt, big), ('!'+fmt, big), ('<'+fmt, lil), ('='+fmt, ISBIGENDIAN and big or lil)]: res = struct.pack(xfmt, arg) if res != exp: - raise TestFailed, "pack(%s, %s) -> %s # expected %s" % ( - `fmt`, `arg`, `res`, `exp`) + raise TestFailed, "pack(%r, %r) -> %r # expected %r" % ( + fmt, arg, res, exp) n = struct.calcsize(xfmt) if n != len(res): - raise TestFailed, "calcsize(%s) -> %d # expected %d" % ( - `xfmt`, n, len(res)) + raise TestFailed, "calcsize(%r) -> %d # expected %d" % ( + xfmt, n, len(res)) rev = struct.unpack(xfmt, res)[0] if rev != arg and not asy: - raise TestFailed, "unpack(%s, %s) -> (%s,) # expected (%s,)" % ( - `fmt`, `res`, `rev`, `arg`) + raise TestFailed, "unpack(%r, %r) -> (%r,) # expected (%r,)" % ( + fmt, res, rev, arg) ########################################################################### # Simple native q/Q tests.
