[issue19746] No introspective way to detect ModuleImportFailure in unittest

2015-09-14 Thread Peter
Peter added the comment: This comment is just to note that this change broke our (exotic?) usage of unittest.TestLoader().loadTestsFromName(name) inside a try/except since under Python 3.5 some expected exceptions are no longer raised. My nasty workaround hack:

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-10-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset e906e23931fa by Robert Collins in branch 'default': Close #19746: expose unittest discovery errors on TestLoader.errors https://hg.python.org/cpython/rev/e906e23931fa -- nosy: +python-dev resolution: - fixed stage: - resolved status: open

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-24 Thread Robert Collins
Robert Collins added the comment: Right: the existing code stringifies the original exception and creates an exception object and a closure def test_thing(self): raise exception_obj but that has the stringified original exception. -- ___ Python

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-23 Thread R. David Murray
R. David Murray added the comment: Oh, ok, if the existing glue does it that way, then it seems fine. I thought when I read the code that it was holding a reference to the traceback until it raised the error in the synthetic test. Or do you mean that when exceptions are raised by tests it

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-22 Thread Robert Collins
Robert Collins added the comment: I can certainly write the reporter glue to work with either a string or a full reference. Note that the existing late-reporting glue captures the import error into a string, and then raises an exception containing that string - so what I've done is consistent

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-10 Thread R. David Murray
R. David Murray added the comment: Yeah, I figured out it was loader only errors after I read the code :) load_tests not called is very different from load_tests produced an exception, so the text of the error message should be changed accordingly. I understood your use case more-or-less, my

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-09 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: Added file: http://bugs.python.org/file36587/issue19746-rebased.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19746 ___

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-09 Thread R. David Murray
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

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-09 Thread Robert Collins
Robert Collins added the comment: Thanks; I'm still learning how to get the system here to jump appropriately :). I thought I'd told hg to reset me to trunk... 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

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-08 Thread Robert Collins
Robert Collins added the comment: Here is an implementation. I'm probably missing some finesse in the docs. -- keywords: +patch Added file: http://bugs.python.org/file36577/issue19746.patch ___ Python tracker rep...@bugs.python.org

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-04-08 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19746 ___ ___ Python-bugs-list

[issue19746] No introspective way to detect ModuleImportFailure

2013-11-24 Thread Michael Foord
Michael Foord added the comment: Seems like a perfectly reasonable request. I've no particular preference on an api for this though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19746

[issue19746] No introspective way to detect ModuleImportFailure in unittest

2013-11-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- title: No introspective way to detect ModuleImportFailure - No introspective way to detect ModuleImportFailure in unittest ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19746

[issue19746] No introspective way to detect ModuleImportFailure

2013-11-23 Thread Robert Collins
New submission from Robert Collins: https://bugs.launchpad.net/testtools/+bug/1245672 was filed on testtools recently. It would be easier to fix that if there was some way that something loading a test suite could check to see if there were import errors. The current code nicely works in the