Issue 22457: load_tests not invoked in root init .py when start=package root (original ) (raw )Created on 2014-09-22 03:47 by rbcollins , last changed 2022-04-11 14:58 by admin . This issue is now closed .
Messages (9)
msg227250 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-09-22 03:47
python -m unittest discover -t . foo where foo is a package will not trigger load_tests in foo/__init__.py. To reproduce: mkdir -p demo/tests cd demo cat < tests/__init__.py import sys import os def load_tests(loader, tests, pattern): print("HI WE ARE LOADING!") this_dir = os.path.dirname(__file__) tests.addTest(loader.discover(start_dir=this_dir, pattern=pattern)) return tests EOF python -m unittest discover -t . tests
msg227327 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-09-23 08:29
This should fix this issue :)
msg227499 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-09-25 01:06
Updated patch - fixes windows tests for this patch.
msg229702 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-10-19 23:10
Updated patch.
msg230254 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-10-30 03:14
Updated patch, after other recent conflicting changes.
msg230315 - (view)
Author: Robert Collins (rbcollins) *
Date: 2014-10-31 01:00
(Pinging for reviews - I'm going to time out and land this early next week if I can't get a review on it, since this is actually a fairly significant oversight and I don't want unittest2 to run ahead of the stdlib - that way leads unmaintainable madness).
msg230617 - (view)
Author: Michael Foord (michael.foord) *
Date: 2014-11-04 11:45
With one minor doc change (break up the really long sentence), this looks good to go to me.
msg230625 - (view)
Author: Roundup Robot (python-dev)
Date: 2014-11-04 14:10
New changeset ce0dd5e4b801 by Robert Collins in branch 'default': Close #22457 : Honour load_tests in the start_dir of discovery. https://hg.python.org/cpython/rev/ce0dd5e4b801
msg230627 - (view)
Author: Roundup Robot (python-dev)
Date: 2014-11-04 14:44
New changeset 2aac2d76035e by Robert Collins in branch 'default': Fix regression in issue 22457 fix. https://hg.python.org/cpython/rev/2aac2d76035e
History
Date
User
Action
Args
2022-04-11 14:58:08
admin
set
github: 66647
2014-11-04 14:44:17
python-dev
set
messages: +
2014-11-04 14:10:28
python-dev
set
status: open -> closednosy: + python-dev messages: + resolution: fixedstage: resolved
2014-11-04 11:45:59
michael.foord
set
messages: +
2014-11-03 09:38:14
rbcollins
set
files: + issue22457.patch
2014-10-31 01:00:59
rbcollins
set
messages: +
2014-10-30 03:19:57
rbcollins
set
type: behaviorversions: + Python 3.5
2014-10-30 03:14:47
rbcollins
set
files: + issue22457.patch messages: +
2014-10-19 23:10:23
rbcollins
set
files: + issue22457.patch messages: +
2014-10-19 23:09:33
rbcollins
set
files: - issue22457.diff
2014-09-25 01:06:11
rbcollins
set
files: + issue22457.diff messages: +
2014-09-23 08:29:23
rbcollins
set
files: + issue22457.patch keywords: + patch messages: +
2014-09-22 07:40:26
ned.deily
set
nosy: + ezio.melotti , michael.foord
2014-09-22 04:16:40
zzzeek
set
nosy: + zzzeek
2014-09-22 03:47:54
rbcollins
create