New submission from Robert Collins:
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
----------
messages: 227250
nosy: rbcollins
priority: normal
severity: normal
status: open
title: load_tests not invoked in root __init__.py when start=package root
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22457>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com