Simple fixes.

This commit is contained in:
Thomas Heller 2007-07-12 19:42:59 +00:00
parent 3821e31d19
commit f0d8b6eee9
2 changed files with 4 additions and 10 deletions

View File

@ -22,7 +22,7 @@ class ReprTest(unittest.TestCase):
self.failUnlessEqual("<X object at", repr(typ(42))[:12])
def test_char(self):
self.failUnlessEqual("c_char('x')", repr(c_char('x')))
self.failUnlessEqual("c_char(s'x')", repr(c_char('x')))
self.failUnlessEqual("<X object at", repr(X('x'))[:12])
if __name__ == "__main__":

View File

@ -291,15 +291,9 @@ class StructureTestCase(unittest.TestCase):
cls, msg = self.get_except(Person, "Someone", (1, 2))
self.failUnlessEqual(cls, RuntimeError)
# In Python 2.5, Exception is a new-style class, and the repr changed
if issubclass(Exception, object):
self.failUnlessEqual(msg,
"(Phone) <type 'TypeError'>: "
"expected string or Unicode object, int found")
else:
self.failUnlessEqual(msg,
"(Phone) TypeError: "
"expected string or Unicode object, int found")
"expected string, int found")
cls, msg = self.get_except(Person, "Someone", ("a", "b", "c"))
self.failUnlessEqual(cls, RuntimeError)