Issue 26481: unittest discovery process not working without .py source files (original) (raw)

Created on 2016-03-04 17:09 by stefan, last changed 2022-04-11 14:58 by admin. 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
2022-04-11 14:58:28 admin set github: 70668
2016-04-27 08:46:50 martin.panter set status: open -> closednosy: + martin.pantermessages: + superseder: unittest fails with "Start directory is not importable" when trying to run sourceless testsresolution: duplicate
2016-03-14 01:38:47 rbcollins set status: closed -> openresolution: not a bug -> (no value)messages: + stage: resolved -> test needed
2016-03-14 01:35:28 rbcollins set status: open -> closedtype: behaviormessages: + resolution: not a bugstage: resolved
2016-03-06 02:27:45 ned.deily set nosy: + rbcollins, ezio.melotti, michael.foord
2016-03-04 17:09:32 stefan create