[issue19746] No introspective way to detect ModuleImportFailure in unittest

R. David Murray report at bugs.python.org
Wed Sep 10 03:36:22 CEST 2014


R. David Murray added the comment:

Your patch isn't diffed against a revision from the cpython repo, and apparently didn't apply cleanly to tip, so no review link was generated.  I  uploaded a rebased patch to review, but don't actually have any line by line comments.

You are right about the docs.  Reading that, I thought it was saying that errors would have a list of the errors that show up in the summary as Errors=N, and not the ones that show up as Failures=N, which of course is completely off base for two reasons (but, then, I can never remember the difference between Failure and Error and always ignore what type the test failures are).

Anyway, you probably want to talk about actual error types.  I understand ImportError, but I have no idea what would trigger the 'Failed to call load_tests' error.  Nor is it clear what would be a fatal error (easier just to say which errors are trapped, I think). It should also be mentioned that the contents of the list are an error message followed by a full traceback.  And, frankly, I'm not sure why this is useful, and in particular why this implementation satisfies your use case.

(I'm more interested in the issue 7559 patch, but since it based on this one I don't think I can just rebase it to review it.)

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19746>
_______________________________________


More information about the Python-bugs-list mailing list