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 2016年04月26日 13:42 by xdegaye, last changed 2022年04月11日 14:58 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| unittest.patch | xdegaye, 2016年04月26日 13:42 | review | ||
| unittest_2.patch | xdegaye, 2016年04月29日 07:51 | with a test case | review | |
| unittest_3.patch | xdegaye, 2016年06月22日 08:03 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg264283 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年04月26日 13:42 | |
unittest fails to load tests when the tests are in a package that has an __init__.pyc file and no __init__.py file. Patch attached. |
|||
| msg264338 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年04月27日 01:53 | |
Is this the same bug as Issue 26481? I.e. is it the unittest dicovery mode that is affected? Maybe close the other bug as a duplicate, since Xavier has provided a patch here. |
|||
| msg264361 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年04月27日 08:13 | |
It seems to be the same bug. Source-less distributions are useful on mobile devices where space is sparse. |
|||
| msg264431 - (view) | Author: Robert Collins (rbcollins) * (Python committer) | Date: 2016年04月28日 14:31 | |
Could you please add a test case. |
|||
| msg264472 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年04月29日 07:51 | |
Here is the patch with a test case. I have checked that the new test case fails with 'Start directory is not importable"' when loader.py is not patched. |
|||
| msg268918 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年06月20日 18:36 | |
Thanks for the review Pamela, indeed self.vfs is not defined. The patched test_unittest runs without failure because the list_dir() nested function is never called. It is also never called in the un-patched version. Actually the un-patched test_discover_start_dir_is_package_calls_package_load_tests runs without failure when changing '__init__.py' of vfs to 'foo' or whatever :( |
|||
| msg269055 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年06月22日 08:03 | |
> the list_dir() nested function is never called Verifying that load_tests is called is the purpose of this test. In this case should_recurse is false in _find_tests() and os.listdir() is not invoked by this method. This new patch does not use vfs and list_dir and uses subtests to also check that TestLoader.discover() does consider that a path refers to a package directory when it contains an '__init__.pyc' file and no '__init__.py' file, and vice-versa. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:30 | admin | set | github: 71046 |
| 2019年12月10日 08:16:01 | xdegaye | set | nosy:
- xdegaye |
| 2019年03月29日 06:37:48 | methane | link | issue32419 superseder |
| 2017年01月05日 16:03:13 | xdegaye | unlink | issue26865 dependencies |
| 2016年07月21日 13:31:21 | xdegaye | set | stage: test needed -> patch review |
| 2016年06月22日 08:03:09 | xdegaye | set | files:
+ unittest_3.patch messages: + msg269055 |
| 2016年06月20日 18:36:50 | xdegaye | set | messages: + msg268918 |
| 2016年06月20日 01:29:56 | Pam.McANulty | set | nosy:
+ Pam.McANulty |
| 2016年05月07日 12:20:25 | ppperry | set | title: unittest fails with "Start directory is not importable" -> unittest fails with "Start directory is not importable" when trying to run sourceless tests |
| 2016年04月29日 07:51:34 | xdegaye | set | files:
+ unittest_2.patch messages: + msg264472 |
| 2016年04月28日 14:31:57 | rbcollins | set | nosy:
+ rbcollins messages: + msg264431 stage: patch review -> test needed |
| 2016年04月27日 08:46:50 | martin.panter | link | issue26481 superseder |
| 2016年04月27日 08:13:14 | xdegaye | set | messages: + msg264361 |
| 2016年04月27日 01:53:35 | martin.panter | set | nosy:
+ martin.panter messages: + msg264338 components: + Tests stage: patch review |
| 2016年04月26日 16:04:41 | zach.ware | link | issue26865 dependencies |
| 2016年04月26日 16:00:38 | Roman.Evstifeev | set | nosy:
+ Roman.Evstifeev |
| 2016年04月26日 13:42:17 | xdegaye | create | |