Im migrating from PyUnit to Pytest, and I found, that Pytest, unlike PyUnit, does not distinguish fails and errors in test report in quick report while running tests (where dots are printed). How to teach Pytest do do it?
UPDATE
Seems like it is valid only for PyUnit tests executed with Pytest, thanks to flub for the clue.
Code:
import unittest
class TestErrorFail(unittest.TestCase):
def test_error(self):
raise Exception('oops')
def test_fail(self):
self.assertTrue(False)
Output:
================================ test session starts =================================
platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2
plugins: django
collected 2 items
sometests.py FF
====================================== FAILURES ======================================
______________________________ TestErrorFail.test_error ______________________________
self = <sometests.TestErrorFail testMethod=test_error>
def test_error(self):
> raise Exception('oops')
E Exception: oops
sometests.py:5: Exception
______________________________ TestErrorFail.test_fail _______________________________
self = <sometests.TestErrorFail testMethod=test_fail>
def test_fail(self):
> self.assertTrue(False)
E AssertionError: False is not true
sometests.py:8: AssertionError
============================== 2 failed in 0.69 seconds ==============================