#28452: Consider adding a test command argument --locals to show traceback 
locals
-------------------------------------+-------------------------------------
     Reporter:  David Sanders        |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Someday/Maybe
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Adam (Chainz) Johnson):

 > Well it might generate quite lot of output

 A valid concern, but normally more output is better for debugging. Most
 functions have a handful of locals. Pytest shows locals by default as
 well, so there's a precedent.

 > it potentially can output secrets that you don't want to leak out.

 I don't think this is much of a concern, normally those with the ability
 to see test results already have the ability to see or run the test code,
 and thus find the secrets. Additionally, many test assertions already can
 output secrets.

 > There might be some risk of heading down the path of reimplementing many
 features of ​pytest.

 I agree, we don't want Django's test framework to reinvent the wheel. But
 this feature is only providing the ability to use something already within
 unittest.

 I'd be in favour of passing `tb_locals=True` always, instead of adding a
 flag to make it optional. Using a flag would make the feature hard to
 discover feature and "yet another thing to think about." Users can
 override the test runner themselves as shown to undo this change if they
 want.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28452#comment:5>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1ed6892c7df1779341d860b3f3bbb61b%40djangoproject.com.

Reply via email to