This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author py.user
Recipients docs@python, py.user
Date 2013-07-27.05:12:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374901937.1.0.747872580847.issue18566@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-07-27 05:12:17py.usersetrecipients: + py.user, docs@python
2013-07-27 05:12:17py.usersetmessageid: <1374901937.1.0.747872580847.issue18566@psf.upfronthosting.co.za>
2013-07-27 05:12:16py.userlinkissue18566 messages
2013-07-27 05:12:16py.usercreate