Kaydet (Commit) d1befd7c authored tarafından Neal Norwitz's avatar Neal Norwitz

Add some info to the failure messages

üst 36dbcb9e
...@@ -48,7 +48,7 @@ class ErrnoAttributeTests(unittest.TestCase): ...@@ -48,7 +48,7 @@ class ErrnoAttributeTests(unittest.TestCase):
def test_using_errorcode(self): def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module. # Every key value in errno.errorcode should be on the module.
for value in errno.errorcode.itervalues(): for value in errno.errorcode.itervalues():
self.assert_(hasattr(errno, value)) self.assert_(hasattr(errno, value), 'no %s attr in errno' % value)
class ErrorcodeTests(unittest.TestCase): class ErrorcodeTests(unittest.TestCase):
...@@ -56,7 +56,8 @@ class ErrorcodeTests(unittest.TestCase): ...@@ -56,7 +56,8 @@ class ErrorcodeTests(unittest.TestCase):
def test_attributes_in_errorcode(self): def test_attributes_in_errorcode(self):
for attribute in errno.__dict__.iterkeys(): for attribute in errno.__dict__.iterkeys():
if attribute.isupper(): if attribute.isupper():
self.assert_(getattr(errno, attribute) in errno.errorcode) self.assert_(getattr(errno, attribute) in errno.errorcode,
'no %s attr in errno.errorcode' % attribute)
def test_main(): def test_main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment