This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "-m unittest --help" says nothing about direct script exection
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Ilya Kazakevich, berker.peksag, docs@python, ezio.melotti, louielu, michael.foord, r.david.murray, rbcollins
Priority: normal Keywords:

Created on 2017-04-15 20:49 by Ilya Kazakevich, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1178 merged louielu, 2017-04-19 14:16
PR 1202 merged berker.peksag, 2017-04-20 03:49
PR 1203 merged berker.peksag, 2017-04-20 03:51
Messages (7)
msg291729 - (view) Author: Ilya Kazakevich (Ilya Kazakevich) Date: 2017-04-15 20:49
In Py3 it is possible to run test filelike 
"python -m unittest tests/test_something.py" (it is *not* possible in Py2!)
Here is doc: https://docs.python.org/3/library/unittest.html

But "--help" seems to be simply copied from Py2 because it does not have information nor examples about such execution. 

Please add it to "examples" section at least because this type of usage is very useful.
msg291730 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-04-15 21:09
Agreed that it looks like another example line should be added to the help for this case.
msg291886 - (view) Author: Louie Lu (louielu) * Date: 2017-04-19 14:17
Add a simple line to `MAIN_EXAMPLES`:

"%(prog)s path/to/test_file.py      - run tests from test_file.py"
msg291936 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-04-20 03:47
New changeset f7e62cf8adfb8ab6a6a870903defe8ff218a0383 by Berker Peksag (Louie Lu) in branch 'master':
bpo-30078: Add an example of passing a path to unittest (#1178)
https://github.com/python/cpython/commit/f7e62cf8adfb8ab6a6a870903defe8ff218a0383
msg291942 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-04-20 04:36
New changeset 596e714d79a22d1d53f26ae1a579dcd43f15865a by Berker Peksag in branch '3.6':
bpo-30078: Add an example of passing a path to unittest (GH-1178)
https://github.com/python/cpython/commit/596e714d79a22d1d53f26ae1a579dcd43f15865a
msg291943 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-04-20 04:37
New changeset 6fb0f801d73b1e2794888772d016d978eccf52a6 by Berker Peksag in branch '3.5':
bpo-30078: Add an example of passing a path to unittest (GH-1178)
https://github.com/python/cpython/commit/6fb0f801d73b1e2794888772d016d978eccf52a6
msg291944 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-04-20 04:37
Thanks!
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74264
2017-04-20 04:37:46berker.peksagsetstatus: open -> closed
versions: + Python 3.5
type: enhancement
messages: + msg291944

resolution: fixed
stage: patch review -> resolved
2017-04-20 04:37:20berker.peksagsetmessages: + msg291943
2017-04-20 04:36:59berker.peksagsetmessages: + msg291942
2017-04-20 03:51:13berker.peksagsetpull_requests: + pull_request1328
2017-04-20 03:49:38berker.peksagsetpull_requests: + pull_request1327
2017-04-20 03:47:01berker.peksagsetnosy: + berker.peksag
messages: + msg291936
2017-04-19 21:58:35serhiy.storchakasetnosy: + rbcollins, ezio.melotti, michael.foord

stage: needs patch -> patch review
2017-04-19 14:17:19louielusetnosy: + louielu
messages: + msg291886
2017-04-19 14:16:41louielusetpull_requests: + pull_request1306
2017-04-15 21:09:19r.david.murraysetversions: + Python 3.7, - Python 3.3, Python 3.4, Python 3.5
nosy: + r.david.murray

messages: + msg291730

stage: needs patch
2017-04-15 20:49:45Ilya Kazakevichcreate