Robert Collins added the comment:
Thanks for the patch!
--
resolution: - fixed
stage: needs patch - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22812
___
Roundup Robot added the comment:
New changeset e285606efb82 by Robert Collins in branch '3.4':
Issue #22812: Fix unittest discovery examples.
https://hg.python.org/cpython/rev/e285606efb82
New changeset 875a851b9d5a by Robert Collins in branch '3.5':
Issue #22812: Fix unittest discovery
Roundup Robot added the comment:
New changeset 3256764fadae by Robert Collins in branch '2.7':
Issue #22812: Fix unittest discovery examples.
https://hg.python.org/cpython/rev/3256764fadae
--
nosy: +python-dev
___
Python tracker
Pam McA'Nulty added the comment:
Here's a version of the docs with double quotes
--
Added file:
http://bugs.python.org/file39033/cpython-22812-discovery-double-quotes-v3.patch
___
Python tracker rep...@bugs.python.org
Zachary Ware added the comment:
Looking deeper at this, I think the best solution is to use '*.py' instead of
'*.py' without changing the code at all. Quoting on the Windows shell is
somewhat of a nightmare (see my example on Rietveld), but using double quotes
works on both Windows and
R. David Murray added the comment:
I should clarify that some unix shells will pass the glob through if there are
no files that match, while some will generate the 'no matching files' error
message. The former is actually worse, since that means that sometimes it
works without the quotes,
Pam McA'Nulty added the comment:
Thanks, Zach for both the comments and the mention of the email bounce. I
changed jobs and didn't have this site listed in my must update email address
list (fixed now)
Should I re-update the doc patch and put in double quotes?
--
R. David Murray added the comment:
Ah, but the quotes *are* necessary on unix. Without the quotes, the shell will
try to fill in the glob, which will either fail with an error that no files
match or (worse) succeed and turn the pattern into a list of filenames. Which
is why Zach is
Pam McA'Nulty added the comment:
This version of the patch just updates the docs. Since the quotes aren't
really necessary for the example to work, the patch removes the single quotes
from the example.
I don't think that the python unittest documentation should explain/document
the
Pam McA'Nulty added the comment:
Remove quotes from quoted patterns only on windows systems (since if the quotes
get parsed into the pattern field on a non-windows system, one should respect
the user's command line efforts).
Test uses unittest.mock.patch to test windows path.
--
Zachary Ware added the comment:
I left a comment on Rietveld. Also, the test doesn't pass on Windows:
test test_unittest failed -- Traceback (most recent call last):
File C:\Data\code\CPython\hg.python.org\devinabox\cpython\lib\unittest\test\t
est_discovery.py, line 677, in
Zachary Ware added the comment:
As an aside: Pam, I got a bounce notice from the email that Rietveld tried to
send you. It claims that your email account is disabled, though I suspect that
might be it's way of saying it thinks Rietveld is spam (since it tries to send
in the reviewer's name).
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
stage: - needs patch
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22812
___
New submission from Robert Collins:
From https://code.google.com/p/unittest-ext/issues/detail?id=13
The following is incorrect on Windows:
python -m unittest discover -p '*.py'
It should be without the single quotes around the .py:
python -m unittest discover -p *.py
This needs to
R. David Murray added the comment:
Why doesn't it work with the quotes? Wouldn't it be better to make it work?
Or is it as simple as changing the example to use double quotes?
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
Robert Collins added the comment:
I agree. IIRC the windows shell passes the argument as '*.py' rather than as
*.py, so when we glob it we get no files, as no python files end with an
apostrophe.
--
___
Python tracker rep...@bugs.python.org
16 matches
Mail list logo