R. David Murray added the comment:
Thanks for tackling this. It's been bugging me almost daily this past week,
but as usual when this bug is in my face I had no time to actually work on a
fix.
I applied this patch to default, put an invalid import in test_os, and this is
the result:
rdmurray@pydev:~/python/p35>./python -m unittest test.test_os
Traceback (most recent call last):
File "/home/rdmurray/python/p35/Lib/unittest/loader.py", line 140, in
loadTestsFromName
module = __import__(module_name)
File "/home/rdmurray/python/p35/Lib/test/test_os.py", line 5, in <module>
import foobar
ImportError: No module named 'foobar'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/rdmurray/python/p35/Lib/runpy.py", line 170, in
_run_module_as_main
"__main__", mod_spec)
File "/home/rdmurray/python/p35/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/rdmurray/python/p35/Lib/unittest/__main__.py", line 18, in
<module>
main(module=None)
File "/home/rdmurray/python/p35/Lib/unittest/main.py", line 92, in __init__
self.parseArgs(argv)
File "/home/rdmurray/python/p35/Lib/unittest/main.py", line 139, in parseArgs
self.createTests()
File "/home/rdmurray/python/p35/Lib/unittest/main.py", line 146, in
createTests
self.module)
File "/home/rdmurray/python/p35/Lib/unittest/loader.py", line 202, in
loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/home/rdmurray/python/p35/Lib/unittest/loader.py", line 202, in
<listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "/home/rdmurray/python/p35/Lib/unittest/loader.py", line 145, in
loadTestsFromName
next_attribute, self.suiteClass)
ValueError: need more than 1 value to unpack
I get similar errors if I misspell the module name in on the command line.
>From my point of view this is still an improvement over the status quo, but I
>don't think it is what you had in mind :).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7559>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com