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

Method assertNotHasAttr

Lib/test/support/testcase.py:29–37  ·  view source on GitHub ↗
(self, obj, name, msg=None)

Source from the content-addressed store, hash-verified

27 self.fail(self._formatMessage(msg, standardMsg))
28
29 def assertNotHasAttr(self, obj, name, msg=None):
30 if hasattr(obj, name):
31 if isinstance(obj, types.ModuleType):
32 standardMsg = f'module {obj.__name__!r} has unexpected attribute {name!r}'
33 elif isinstance(obj, type):
34 standardMsg = f'type object {obj.__name__!r} has unexpected attribute {name!r}'
35 else:
36 standardMsg = f'{type(obj).__name__!r} object has unexpected attribute {name!r}'
37 self.fail(self._formatMessage(msg, standardMsg))
38
39 def assertStartsWith(self, s, prefix, msg=None):
40 if s.startswith(prefix):

Callers 15

test_no_updateMethod · 0.45
test_no_updateMethod · 0.45
test_method_registerMethod · 0.45
test_copy_pickleMethod · 0.45
test_metaclassMethod · 0.45
test_object_classMethod · 0.45
test_slotsMethod · 0.45
test_slots_specialMethod · 0.45
test_slots_special2Method · 0.45

Calls 4

hasattrFunction · 0.85
isinstanceFunction · 0.85
_formatMessageMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected