MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_attribute

Function get_attribute

Lib/test/support/__init__.py:179–186  ·  view source on GitHub ↗

Get an attribute, raising SkipTest if AttributeError is raised.

(obj, name)

Source from the content-addressed store, hash-verified

177
178
179def get_attribute(obj, name):
180 """Get an attribute, raising SkipTest if AttributeError is raised."""
181 try:
182 attribute = getattr(obj, name)
183 except AttributeError:
184 raise unittest.SkipTest("object %r has no attribute %r" % (obj, name))
185 else:
186 return attribute
187
188verbose = 1 # Flag set to 0 by regrtest.py
189use_resources = None # Flag set to {} by regrtest.py

Callers 1

test_ioctl.pyFile · 0.90

Calls 1

getattrFunction · 0.85

Tested by

no test coverage detected