summaryrefslogtreecommitdiff
path: root/unit_tests
diff options
context:
space:
mode:
authorkumar <kumar.mcmillan@gmail.com>2011-05-27 10:05:54 -0500
committerkumar <kumar.mcmillan@gmail.com>2011-05-27 10:05:54 -0500
commit8438275967fbd23103caf98eff2a1875dd1e7696 (patch)
tree19567f3750fd6db1ccf55757561e712fdadb624f /unit_tests
parent7b6139f214fbbef84c093b2adf25c0eb38d7f615 (diff)
downloadnose-8438275967fbd23103caf98eff2a1875dd1e7696.tar.gz
case.shortDescription() is more forgiving to __str__ errors (issue 422)
Diffstat (limited to 'unit_tests')
-rw-r--r--unit_tests/test_cases.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/unit_tests/test_cases.py b/unit_tests/test_cases.py
index 27ec4bb..af399e5 100644
--- a/unit_tests/test_cases.py
+++ b/unit_tests/test_cases.py
@@ -259,5 +259,16 @@ class TestNoseTestWrapper(unittest.TestCase):
assert case_c.shortDescription() in (None, # pre 2.7
'test_c (test_cases.TC)') # 2.7
+ def test_unrepresentable_shortDescription(self):
+ class TC(unittest.TestCase):
+ def __str__(self):
+ # see issue 422
+ raise ValueError('simulate some mistake in this code')
+ def runTest(self):
+ pass
+
+ case = nose.case.Test(TC())
+ self.assertEqual(case.shortDescription(), None)
+
if __name__ == '__main__':
unittest.main()