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.
Created on 2012年08月31日 02:52 by eng793, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| glob-cov-incr.patch | eng793, 2012年08月31日 02:52 | patch to test_glob.py | review | |
| test_glob.patch | eng793, 2012年08月31日 21:35 | patch to test_glob.py | review | |
| test_glob.patch | eng793, 2012年09月01日 09:31 | patch to test_glob.py | review | |
| test_glob.patch.updated | r.david.murray, 2012年09月01日 19:24 | review | ||
| issue15826.diff | ezio.melotti, 2013年10月14日 02:05 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg169496 - (view) | Author: Alessandro Moura (eng793) * | Date: 2012年08月31日 02:52 | |
Hi, Here is a patch to increase test coverage of test_glob.py. I added tests where the glob patterns are of type bytes. The coverage (according to coverage.py) is now complete, except for what are clearly artefacts probably caused by the fact that glob is loaded before coverage measurements start (global statements are reported not covered but local ones are). |
|||
| msg169554 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年08月31日 16:25 | |
I think it would be easier to subclass GlobTests and override norm and glob there (assuming that doesn't create problems with some of the tests). |
|||
| msg169586 - (view) | Author: Alessandro Moura (eng793) * | Date: 2012年08月31日 21:35 | |
Agreed, here is the patch where this is done. |
|||
| msg169602 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年09月01日 01:39 | |
Is test_bytes_glob_directory_with_trailing_slash unique to bytes, or should it be added to the base class instead? What would be useful as bytes-only tests, I think, would be tests of non-ascii stuff. Although that makes me wonder, do we test non-ascii unicode in the string tests? I presume that ought to be tested, too, though I suppose that could be tricky if the default encoding of the system the tests are running on can't handle the selected characters (such as, if it is ASCII). Both of those are extras, though, the main question before committing this patch is the first one. |
|||
| msg169617 - (view) | Author: Alessandro Moura (eng793) * | Date: 2012年09月01日 09:31 | |
test_bytes_glob_directory_with_trailing_slash already has a counterpart in the main class, but it is not easily handled by overriding self.glob and self.norm. Since it is only a single test, I just decided to override test_glob_directory_with_trailing_slash from the main class. But looking at this now I realize that I actually created another method with a different name by mistake; so the attached patch changes that. |
|||
| msg169668 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年09月01日 19:24 | |
I've modified your patch slightly (cosmetic only). When I run it on default I get the following: /home/rdmurray/python/p33/Lib/os.py:263: BytesWarning: Comparison between bytes and string if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists /home/rdmurray/python/p33/Lib/glob.py:63: BytesWarning: Comparison between bytes and string if basename == '': These presumably represent bugs. Care to investigate and file issues for them? |
|||
| msg169675 - (view) | Author: Alessandro Moura (eng793) * | Date: 2012年09月01日 22:36 | |
Im OK with the patch changes. ''' /home/rdmurray/python/p33/Lib/os.py:263: BytesWarning: Comparison between bytes and string if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists /home/rdmurray/python/p33/Lib/glob.py:63: BytesWarning: Comparison between bytes and string if basename == '': ''' Yes, I do see these warnings running with -b. I will look into them and try to fix them. |
|||
| msg170869 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年09月21日 09:07 | |
FTR this is addressed in #15845. |
|||
| msg224584 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年08月02日 19:41 | |
GlobTests.glob() tests that glob() for bytes returns the same (encoded) result as glob() for string. Therefore this patch is not needed, it doesn't increase test coverage. |
|||
| msg224718 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2014年08月04日 13:54 | |
OK, I'll close the issue then. Alessandro, thanks anyway for the patch! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 60030 |
| 2014年08月04日 13:54:50 | ezio.melotti | set | status: open -> closed resolution: out of date messages: + msg224718 stage: commit review -> resolved |
| 2014年08月02日 19:41:47 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg224584 |
| 2013年12月22日 21:06:19 | pitrou | set | assignee: ezio.melotti |
| 2013年10月14日 02:05:10 | ezio.melotti | set | files:
+ issue15826.diff stage: patch review -> commit review versions: - Python 3.2, Python 3.3 |
| 2012年09月21日 09:07:22 | ezio.melotti | set | messages: + msg170869 |
| 2012年09月01日 22:36:13 | eng793 | set | messages: + msg169675 |
| 2012年09月01日 19:24:38 | r.david.murray | set | files:
+ test_glob.patch.updated messages: + msg169668 |
| 2012年09月01日 09:31:59 | eng793 | set | files:
+ test_glob.patch messages: + msg169617 |
| 2012年09月01日 01:39:11 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg169602 |
| 2012年08月31日 21:35:08 | eng793 | set | files:
+ test_glob.patch messages: + msg169586 |
| 2012年08月31日 16:25:58 | ezio.melotti | set | versions:
+ Python 3.2, Python 3.4 nosy: + ezio.melotti messages: + msg169554 stage: patch review |
| 2012年08月31日 02:52:14 | eng793 | create | |