diff options
author | Naitree Zhu <Naitreey@gmail.com> | 2019-09-09 22:06:48 +0800 |
---|---|---|
committer | Michael Foord <voidspace@users.noreply.github.com> | 2019-09-09 16:06:48 +0200 |
commit | d5fd75c53fad7049fc640c9a6162d35f0c5bea03 (patch) | |
tree | a5d7e0fc5daeae1188fe18e6bf5541d92aee23c0 /Lib/unittest/test/test_skipping.py | |
parent | 264e034f990240e2aa379d8484b15b9e70c1fad5 (diff) | |
download | cpython-git-d5fd75c53fad7049fc640c9a6162d35f0c5bea03.tar.gz |
bpo-34596: Fallback to a default reason when @unittest.skip is uncalled (#9082)
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled
* Change default reason to empty string
* Fix rst formatting of NEWS entry
Diffstat (limited to 'Lib/unittest/test/test_skipping.py')
-rw-r--r-- | Lib/unittest/test/test_skipping.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_skipping.py b/Lib/unittest/test/test_skipping.py index 71f7b70e47..1c178a95f7 100644 --- a/Lib/unittest/test/test_skipping.py +++ b/Lib/unittest/test/test_skipping.py @@ -255,6 +255,17 @@ class Test_TestSkipping(unittest.TestCase): suite.run(result) self.assertEqual(result.skipped, [(test, "testing")]) + def test_skip_without_reason(self): + class Foo(unittest.TestCase): + @unittest.skip + def test_1(self): + pass + + result = unittest.TestResult() + test = Foo("test_1") + suite = unittest.TestSuite([test]) + suite.run(result) + self.assertEqual(result.skipped, [(test, "")]) if __name__ == "__main__": unittest.main() |