""" $ ./python -m unwrapable_obj.py Before bpo-25998: Traceback (most recent call last): File "Lib/runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "unwrapable_ob.py", line 13, in doctest.testmod() File "Lib/doctest.py", line 1954, in testmod for test in finder.find(m, name, globs=globs, extraglobs=extraglobs): File "Lib/doctest.py", line 932, in find self._find(tests, obj, name, module, source_lines, globs, {}) File "Lib/doctest.py", line 990, in _find unwraped_obj = inspect.unwrap(val) File "Lib/inspect.py", line 520, in unwrap while _is_wrapper(func): File "Lib/inspect.py", line 511, in _is_wrapper return hasattr(f, '__wrapped__') File "unwrapable_ob.py", line 7, in __getattr__ raise RuntimeError("boom") RuntimeError: boom After bpo-25998: 3 items had no tests: __main__ __main__.UnwrapMeAndDie __main__.UnwrapMeAndDie.__getattr__ 0 tests in 3 items. 0 passed and 0 failed. Test passed. """ class UnwrapMeAndDie: def __getattr__(self, name): raise RuntimeError("boom") xxx = UnwrapMeAndDie() if __name__ == "__main__": import doctest doctest.testmod(verbose=True)