Simple fixes.
This commit is contained in:
parent
3821e31d19
commit
f0d8b6eee9
|
@ -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__":
|
||||
|
|
|
@ -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")
|
||||
self.failUnlessEqual(msg,
|
||||
"(Phone) <type 'TypeError'>: "
|
||||
"expected string, int found")
|
||||
|
||||
cls, msg = self.get_except(Person, "Someone", ("a", "b", "c"))
|
||||
self.failUnlessEqual(cls, RuntimeError)
|
||||
|
|
Loading…
Reference in New Issue