()
| 59 | |
| 60 | |
| 61 | def test_object_resolver_error(): |
| 62 | from _pydevd_bundle.pydevd_resolver import DefaultResolver |
| 63 | |
| 64 | default_resolver = DefaultResolver() |
| 65 | |
| 66 | class MyObject(object): |
| 67 | def __init__(self): |
| 68 | self.a = 10 |
| 69 | |
| 70 | def __dir__(self): |
| 71 | return ["a", "b"] |
| 72 | |
| 73 | def __getattribute__(self, attr_name): |
| 74 | if attr_name == "b": |
| 75 | raise RuntimeError("unavailable") |
| 76 | return object.__getattribute__(self, attr_name) |
| 77 | |
| 78 | obj = MyObject() |
| 79 | dictionary = default_resolver.get_dictionary(obj) |
| 80 | b_value = dictionary.pop("b") |
| 81 | assert dictionary == {"a": 10} |
| 82 | assert 'raise RuntimeError("unavailable")' in b_value |
| 83 | |
| 84 | contents_debug_adapter_protocol = default_resolver.get_contents_debug_adapter_protocol(obj) |
| 85 | b_value = contents_debug_adapter_protocol.pop(-1) |
| 86 | assert contents_debug_adapter_protocol == [("a", 10, ".a")] |
| 87 | assert b_value[0] == "b" |
| 88 | assert 'raise RuntimeError("unavailable")' in b_value[1] |
| 89 | assert b_value[2] == ".b" |
| 90 | |
| 91 | |
| 92 | def test_object_resolver_hasattr_error(): |
nothing calls this directly
no test coverage detected