mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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
This commit is contained in:
parent
264e034f99
commit
d5fd75c53f
3 changed files with 18 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue