#23778: Running tests outside the test runner needs clarification
--------------------------------------+------------------------------------
     Reporter:  Starou                |                    Owner:  Starou
         Type:  Cleanup/optimization  |                   Status:  assigned
    Component:  Documentation         |                  Version:  1.7
     Severity:  Normal                |               Resolution:
     Keywords:  tests run_tests       |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by prestontimmons):

 This example is okay. I have a couple thoughts, though:

 I assume the most common case for this is creating a test runner for
 reusable apps. In that case, messing with `PYTHONPATH` is often
 unnecessary since you can either `pip install --editable` or `python
 setup.py develop` to put your packages on the path. Is it worth mentioning
 this?

 The example hard-codes the app label in `runner.run_tests(['my_app'])`.
 Even with reusable apps it's nice to have the option of passing a path to
 a test case, like `./runtests.py myapp.tests.SomeCase.test`. Should the
 example take that into consideration?

 I usually do something like:

 {{{
 runner.runtests(sys.argv[1:] or ["myapp"])
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23778#comment:4>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1c24a0c5e3d2f46ab2f07581065480c2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to