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 2013年06月20日 20:30 by zach.ware, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_json_discovery-3.3.diff | zach.ware, 2013年06月20日 20:30 | test_json test_main->unittest.main conversion | ||
| test_json_discovery.v2-3.3.diff | zach.ware, 2013年08月08日 03:03 | Version 2 | ||
| Messages (6) | |||
|---|---|---|---|
| msg191537 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2013年06月20日 20:30 | |
Technically, test discovery already works for test_json.py / json_tests, but not the way really expected (each test file is discovered individually), and not as simply as it could. The attached patch does the following: - remove test_json.py - rename json_tests to test_json (to match all other tests, following the example of test_email and test_importlib) - remove main() and 'if __name__ == "__main__"' stanza from __init__.py - rename test_suite() to load_tests(*args) - Add test_json/__main__.py, which calls unittest.main I believe this is the simplest, cleanest way to convert the json tests from test_main to unittest.main(). The patch is against 3.3; there are changes in 3.4 that make a patch against it not apply to 3.3. It merges forward easily, though. |
|||
| msg194480 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年08月05日 14:08 | |
I like the patch. Can you make "./python Lib/test/test_json/" work too? Currently it doesn't seem to work (it works for e.g. "./python Lib/test/test_email/"). |
|||
| msg194500 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2013年08月05日 18:32 | |
Make sure the tests still work when run from an installed Python rather than just from a build directory. In particular, if you rename test directories, you will need to change LIBSUBDIRS in Makefile.pre.in to ensure the directories and their files are installed. |
|||
| msg194640 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2013年08月08日 03:03 | |
Here's a new patch; test_json.__main__ now uses an absolute import rather than trying to use a relative one. Also, Makefile.pre.in is fixed (thank you, Ned!). |
|||
| msg194664 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年08月08日 12:31 | |
New changeset 95cf8640b271 by Ezio Melotti in branch '3.3': #18273: move the tests in Lib/test/json_tests to Lib/test/test_json and make them discoverable by unittest. Patch by Zachary Ware. http://hg.python.org/cpython/rev/95cf8640b271 New changeset f7ed301e7199 by Ezio Melotti in branch 'default': #18273: merge with 3.3. http://hg.python.org/cpython/rev/f7ed301e7199 |
|||
| msg194665 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年08月08日 12:35 | |
Fixed, thanks for the patch! (Thanks Ned too!) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:47 | admin | set | github: 62473 |
| 2013年08月08日 12:35:23 | ezio.melotti | set | status: open -> closed messages: + msg194665 assignee: ezio.melotti resolution: fixed stage: patch review -> resolved |
| 2013年08月08日 12:31:47 | python-dev | set | nosy:
+ python-dev messages: + msg194664 |
| 2013年08月08日 03:03:33 | zach.ware | set | files:
+ test_json_discovery.v2-3.3.diff messages: + msg194640 |
| 2013年08月05日 18:32:43 | ned.deily | set | nosy:
+ ned.deily messages: + msg194500 |
| 2013年08月05日 14:08:50 | ezio.melotti | set | messages:
+ msg194480 stage: patch review |
| 2013年06月20日 20:30:20 | zach.ware | create | |