Issue35617
Created on 2018-12-30 09:32 by Simon Fagerholm, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11364 | open | python-dev, 2018-12-30 09:53 | |
| PR 11364 | python-dev, 2018-12-30 09:53 | ||
| PR 11364 | open | python-dev, 2018-12-30 09:53 | |
| PR 11364 | open | python-dev, 2018-12-30 09:53 | |
| Messages (6) | |||
|---|---|---|---|
| msg332748 - (view) | Author: Simon Fagerholm (Simon Fagerholm) * | Date: 2018-12-30 09:32 | |
When "python -m unittest discover" is run in a folder that is an implicit namespace package with the structure as below, no tests are discovered.
The condition that the tests must be importable from the top level directory is fulfilled and has been tested by importing the tests from the top level.
I did some investigating and have a PR underway that seems to fix it
Example project structure is:
.
├── requirements.txt
├── main.py
├── tests
├── unit
│ └── test_thing1.py
└── integration.py
└── test_integration_thing1.py
|
|||
| msg332750 - (view) | Author: Simon Fagerholm (Simon Fagerholm) * | Date: 2018-12-30 10:02 | |
Issue originally from SO: https://stackoverflow.com/questions/46976256/recursive-unittest-discovery-with-python3-and-without-init-py-files |
|||
| msg332768 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2018-12-30 22:29 | |
Is this related to Issue 23882? That one is about making discovery work when “__init__.py” files are removed. |
|||
| msg332770 - (view) | Author: Simon Fagerholm (Simon Fagerholm) * | Date: 2018-12-30 22:56 | |
Martin: Yeah, they same to be same! Can't believe I didn't find it |
|||
| msg332787 - (view) | Author: Emmanuel Arias (eamanu) * | Date: 2018-12-31 02:13 | |
Hi! IMO its a good propose. You will have to modify some tests. |
|||
| msg332992 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2019-01-04 19:28 | |
If this is truly a duplicate, this should be closed and the issue number in the pr title changed to 23882. Any reviewer should look at both proposed fixes, as they are not the same. The other patch has what looks like the beginning of a test. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:09 | admin | set | github: 79798 |
| 2020-07-19 03:49:02 | methane | set | keywords:
patch, patch, patch, patch status: open -> closed superseder: unittest discovery doesn't detect namespace packages when given no parameters resolution: duplicate stage: patch review -> resolved |
| 2019-10-28 20:48:34 | pconnell | set | nosy:
+ pconnell |
| 2019-08-19 21:42:26 | rgammans | set | nosy:
+ rgammans |
| 2019-01-04 19:28:19 | terry.reedy | set | keywords:
patch, patch, patch, patch nosy: + terry.reedy messages: + msg332992 |
| 2018-12-31 02:13:19 | eamanu | set | nosy:
+ eamanu messages:
+ msg332787 |
| 2018-12-30 22:56:41 | Simon Fagerholm | set | messages: + msg332770 |
| 2018-12-30 22:29:01 | martin.panter | set | keywords:
patch, patch, patch, patch nosy: + martin.panter messages: + msg332768 |
| 2018-12-30 11:16:16 | eric.smith | set | keywords:
patch, patch, patch, patch nosy: + eric.smith |
| 2018-12-30 10:02:20 | Simon Fagerholm | set | messages: + msg332750 |
| 2018-12-30 09:53:21 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request10694 |
| 2018-12-30 09:53:17 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request10693 |
| 2018-12-30 09:53:15 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request10692 |
| 2018-12-30 09:53:11 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request10691 |
| 2018-12-30 09:32:16 | Simon Fagerholm | create | |
