diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-09-21 16:35:28 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-09-21 16:35:28 (GMT) |
commit | b3d4e7fe718f82e82861ab8fbb80c60177699a8b (patch) | |
tree | f9063ee65d6b9a06dce29bc0cf2928325316799c /Lib/unittest/test | |
parent | 349f552507dbdd401202f36621928342030fe2a1 (diff) | |
parent | 16ea19fc6653ee4ec1be7cd0206073962119ac08 (diff) | |
download | cpython-b3d4e7fe718f82e82861ab8fbb80c60177699a8b.zip cpython-b3d4e7fe718f82e82861ab8fbb80c60177699a8b.tar.gz cpython-b3d4e7fe718f82e82861ab8fbb80c60177699a8b.tar.bz2 |
Issue #25651: Merge from 3.5
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r-- | Lib/unittest/test/test_result.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_result.py b/Lib/unittest/test/test_result.py index e39e2ea..0a61553 100644 --- a/Lib/unittest/test/test_result.py +++ b/Lib/unittest/test/test_result.py @@ -323,6 +323,16 @@ class Test_TestResult(unittest.TestCase): 'testGetSubTestDescriptionWithoutDocstringAndParams ' '(' + __name__ + '.Test_TestResult) (<subtest>)') + def testGetSubTestDescriptionForFalsyValues(self): + expected = 'testGetSubTestDescriptionForFalsyValues (%s.Test_TestResult) [%s]' + result = unittest.TextTestResult(None, True, 1) + for arg in [0, None, []]: + with self.subTest(arg): + self.assertEqual( + result.getDescription(self._subtest), + expected % (__name__, arg) + ) + def testGetNestedSubTestDescriptionWithoutDocstring(self): with self.subTest(foo=1): with self.subTest(bar=2): |