diff options
author | Robert Collins <rbtcollins@hp.com> | 2014-10-29 19:27:27 (GMT) |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2014-10-29 19:27:27 (GMT) |
commit | 659dd625b4c3489fbefe9fa866d87bc2b5e14366 (patch) | |
tree | 20fe35b94b5a869c3817810a37fa051af09af73e /Doc/library/unittest.rst | |
parent | c1345840202fed6f1405efec97cd2a147aa5a92e (diff) | |
download | cpython-659dd625b4c3489fbefe9fa866d87bc2b5e14366.zip cpython-659dd625b4c3489fbefe9fa866d87bc2b5e14366.tar.gz cpython-659dd625b4c3489fbefe9fa866d87bc2b5e14366.tar.bz2 |
Close #7559: ImportError when loading a test now shown as ImportError.
Previously the ImportError was only shown if the top level containing
package failed to import, with other ImportErrors showing up as
AttributeError - hiding the real cause. As part of this,
`TestLoader.loadTestsFromNames` now captures errors to self.errors.
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 375defa..355e31f 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1629,6 +1629,12 @@ Loading and running tests The method optionally resolves *name* relative to the given *module*. + .. versionchanged:: 3.5 + If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing + *name* then a synthetic test that raises that error when run will be + returned. These errors are included in the errors accumulated by + self.errors. + .. method:: loadTestsFromNames(names, module=None) |