Message193772
http://docs.python.org/3/library/unittest.html#unittest.TestCase.setUp
"any exception raised by this method will be considered an error rather than a test failure"
http://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown
"Any exception raised by this method will be considered an error rather than a test failure."
utest.py
#!/usr/bin/env python3
import unittest
class Test(unittest.TestCase):
def setUp(self):
raise AssertionError
def tearDown(self):
raise AssertionError
def test_nothing(self):
pass
[guest@localhost py]$ python3 -m unittest -v utest
test_nothing (utest.Test) ... FAIL
======================================================================
FAIL: test_nothing (utest.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./utest.py", line 8, in setUp
raise AssertionError
AssertionError
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (failures=1)
[guest@localhost py]$
also raising unittest.SkipTest works properly |
|
Date |
User |
Action |
Args |
2013-07-27 05:12:17 | py.user | set | recipients:
+ py.user, docs@python |
2013-07-27 05:12:17 | py.user | set | messageid: <1374901937.1.0.747872580847.issue18566@psf.upfronthosting.co.za> |
2013-07-27 05:12:16 | py.user | link | issue18566 messages |
2013-07-27 05:12:16 | py.user | create | |
|