[pypy-svn] pypy default: Reindent test code, it will also give better messages on failure

amauryfa commits-noreply at bitbucket.org
Mon Feb 14 10:51:22 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41891:77c809396311
Date: 2011-02-14 10:45 +0100
http://bitbucket.org/pypy/pypy/changeset/77c809396311/

Log:	Reindent test code, it will also give better messages on failure

diff --git a/pypy/module/_codecs/test/test_codecs.py b/pypy/module/_codecs/test/test_codecs.py
--- a/pypy/module/_codecs/test/test_codecs.py
+++ b/pypy/module/_codecs/test/test_codecs.py
@@ -408,18 +408,13 @@
 
     def test_errors(self):
         import codecs
-        assert (
-            codecs.replace_errors(UnicodeEncodeError("ascii", u"\u3042", 0, 1, "ouch"))) == (
-            (u"?", 1)
-        )
-        assert (
-            codecs.replace_errors(UnicodeDecodeError("ascii", "\xff", 0, 1, "ouch"))) == (
-            (u"\ufffd", 1)
-        )
-        assert (
-            codecs.replace_errors(UnicodeTranslateError(u"\u3042", 0, 1, "ouch"))) == (
-            (u"\ufffd", 1)
-        )
+        assert codecs.replace_errors(UnicodeEncodeError(
+            "ascii", u"\u3042", 0, 1, "ouch")) == (u"?", 1)
+        assert codecs.replace_errors(UnicodeDecodeError(
+            "ascii", "\xff", 0, 1, "ouch")) == (u"\ufffd", 1)
+        assert codecs.replace_errors(UnicodeTranslateError(
+            u"\u3042", 0, 1, "ouch")) == (u"\ufffd", 1)
+
         class BadStartUnicodeEncodeError(UnicodeEncodeError):
             def __init__(self):
                 UnicodeEncodeError.__init__(self, "ascii", u"", 0, 1, "bad")


More information about the Pypy-commit mailing list