classification
Title: unittest discovery process not working without .py source files
Type: behavior Stage: test needed
Components: Library (Lib) Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: unittest fails with "Start directory is not importable" when trying to run sourceless tests
View: 26859
Assigned To: Nosy List: ezio.melotti, martin.panter, michael.foord, rbcollins, stefan
Priority: normal Keywords:

Created on 2016-03-04 17:09 by stefan, last changed 2016-04-27 08:46 by martin.panter. This issue is now closed.

Messages (4)
msg261192 - (view) Author: Stefan Seefeld (stefan) * (Python committer) Date: 2016-03-04 17:09
The unittest test discovery right now only looks into sub-packages if they contain a `__init__.py` file. That's an unnecessary requirement, as packages are also importable if only `__init__.pyc` is present.
msg261707 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2016-03-14 01:35
Python has stopped supporting .pyc-only distributions - see https://www.python.org/dev/peps/pep-3147/#case-3-pycache-foo-magic-pyc-with-no-source - and so, while what you are seeing is inconsistent with import in some older python's, it is not a bug in newer Python's, and I don't see any benefit in doing a backport-only fix for it.
msg261708 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2016-03-14 01:38
Sorry, I missed the little footnote on case 4 about still supporting source-less distributions. I guess in that context we do still need to support this.

However - please check that this does indeed happen on Python master - 3.6. unittest does evolve and if you're testing on 2.7 or something your bug is perhaps already fixed.
msg264363 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-04-27 08:46
Please see Issue 26859; I think it is describing the same problem, and a fix is proposed (although no regression test)
History
Date User Action Args
2016-04-27 08:46:50martin.pantersetstatus: open -> closed

nosy: + martin.panter
messages: + msg264363

superseder: unittest fails with "Start directory is not importable" when trying to run sourceless tests
resolution: duplicate
2016-03-14 01:38:47rbcollinssetstatus: closed -> open
resolution: not a bug -> (no value)
messages: + msg261708

stage: resolved -> test needed
2016-03-14 01:35:28rbcollinssetstatus: open -> closed
type: behavior
messages: + msg261707

resolution: not a bug
stage: resolved
2016-03-06 02:27:45ned.deilysetnosy: + rbcollins, ezio.melotti, michael.foord
2016-03-04 17:09:32stefancreate