#31513: Store failed test info in file
---------------------------------------------+------------------------
               Reporter:  thenewguy          |          Owner:  nobody
                   Type:  New feature        |         Status:  new
              Component:  Testing framework  |        Version:  3.0
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 It would be helpful when some (maybe all?) tests failed their assert
 methods wrote the relevant data to a file unique to the call.

 For example, something like this:



 {{{
 ======================================================================
 FAIL: test_admin_index
 (integration.tests.test_known_url_response.KnownUrlResponseTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/vagrant/integration/tests/test_known_url_response.py", line 24,
 in test_admin_index
     self.assertContains(response, 'Welcome, Fanny')
   File "/home/vagrant/.tox/py36/lib/python3.6/site-
 packages/django/test/testcases.py", line 454, in assertContains
     self.assertTrue(real_count != 0, msg_prefix + "Couldn't find %s in
 response" % text_repr)
 AssertionError: False is not true : Couldn't find 'Welcome, Fanny' in
 response

 }}}

 It is helpful to know that the test failed, but it isn't easy to fix the
 test because the response html isn't available.  Since it is too much to
 display in the console, it would be helpful if the assertContains() method
 logged the response content and failure message to a file and then
 reported the file path in the error message.  Something like... for more
 details view this file: /path/to/failed-test-uuid.log

 Then it would be easy to fix without requiring any adjustments to the test
 output and running the test suite again.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31513>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.9379a5aa292c2ad50b968f04f6381e82%40djangoproject.com.

Reply via email to