Merge "Catch all errors in Mock detector"

This commit is contained in:
Jenkins 2015-12-22 19:55:17 +00:00 committed by Gerrit Code Review
commit 7f799cf5e4
1 changed files with 4 additions and 0 deletions

View File

@ -112,6 +112,10 @@ class TestCase(testtools.TestCase):
full_name, member, container, depth + 1)
except ImportError:
pass # Module cannot be imported - ignore it.
except RuntimeError:
# Something else went wrong when probing the class member.
# See: https://bugs.launchpad.net/trove/+bug/1524918
pass
def _get_loaded_modules(self):
return {name: obj for name, obj in sys.modules.items() if obj}