diff options
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 819fcc5..e64215d 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -463,6 +463,14 @@ class TestRetrievingSourceCode(GetSourceBase): with self.assertRaises(TypeError): inspect.getfile(C) + def test_getfile_broken_repr(self): + class ErrorRepr: + def __repr__(self): + raise Exception('xyz') + er = ErrorRepr() + with self.assertRaises(TypeError): + inspect.getfile(er) + def test_getmodule_recursion(self): from types import ModuleType name = '__inspect_dummy' |