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.

Author rbcollins
Recipients rbcollins
Date 2014-09-22.03:47:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411357674.43.0.0204872118136.issue22457@psf.upfronthosting.co.za>
In-reply-to
Content
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 <<EOF > 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
History
Date User Action Args
2014-09-22 03:47:54rbcollinssetrecipients: + rbcollins
2014-09-22 03:47:54rbcollinssetmessageid: <1411357674.43.0.0204872118136.issue22457@psf.upfronthosting.co.za>
2014-09-22 03:47:54rbcollinslinkissue22457 messages
2014-09-22 03:47:53rbcollinscreate