I find this a bit annoying, getting so many details for a simple failed unit test. Is it possible to suppress everything except the actual specific assert message?
Creating test database for alias 'default'... .F ====================================================================== FAIL: test_get_sales_item_for_company (my_app.tests.SalesItemModelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/kave/projects/my/my_app/tests.py", line 61, in test_get_sales_item_for_company self.assertEqual(sales_items.count(), 1, 'Expected one sales item for this company, but got %s' % sales_items.count()) AssertionError: Expected one sales item for this company, but got 2 ---------------------------------------------------------------------- Ran 2 tests in 0.313s FAILED (failures=1) Destroying test database for alias 'default'...
I find this bit unnecessary. I need to know the name of the test (method) that failed, and the assert message. No trace needed really.
Traceback (most recent call last): File "/home/kave/projects/my/my_app/tests.py", line 61, in test_get_sales_item_for_company self.assertEqual(sales_items.count(), 1, 'Expected one sales item for this company, but got %s' % sales_items.count())
source share