Message324697
What would be a good default reason? How about the function name?
if isinstance(reason, types.FunctionType):
reason = reason.__name__
For example,
from unittest import TestCase, skip
class Test(TestCase):
@skip
def test_bad_skip(self):
self.assertFalse(1.0)
@skip('always skipped')
def test_good_skip(self):
self.assertFalse(1.0)
$ python -m unittest -v test.py
test_bad_skip (test.Test) ... skipped 'test_bad_skip'
test_good_skip (test.Test) ... skipped 'always skipped'
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK (skipped=2)
But this wouldn't be very helpful if test method is a lambda (just saying...) |
|
Date |
User |
Action |
Args |
2018-09-06 14:58:52 | Naitree Zhu | set | recipients:
+ Naitree Zhu, steven.daprano, zach.ware |
2018-09-06 14:58:52 | Naitree Zhu | set | messageid: <1536245932.88.0.56676864532.issue34596@psf.upfronthosting.co.za> |
2018-09-06 14:58:52 | Naitree Zhu | link | issue34596 messages |
2018-09-06 14:58:52 | Naitree Zhu | create | |
|