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

Method assertNotHasAttr

Lib/unittest/case.py:1395–1403  ·  view source on GitHub ↗
(self, obj, name, msg=None)

Source from the content-addressed store, hash-verified

1393 self.fail(self._formatMessage(msg, standardMsg))
1394
1395 def assertNotHasAttr(self, obj, name, msg=None):
1396 if hasattr(obj, name):
1397 if isinstance(obj, types.ModuleType):
1398 standardMsg = f'module {obj.__name__!r} has unexpected attribute {name!r}'
1399 elif isinstance(obj, type):
1400 standardMsg = f'type object {obj.__name__!r} has unexpected attribute {name!r}'
1401 else:
1402 standardMsg = f'{type(obj).__name__!r} object has unexpected attribute {name!r}'
1403 self.fail(self._formatMessage(msg, standardMsg))
1404
1405 def assertRaisesRegex(self, expected_exception, expected_regex,
1406 *args, **kwargs):

Callers 2

test_class_markerMethod · 0.95
test_class_attrsMethod · 0.95

Calls 4

failMethod · 0.95
_formatMessageMethod · 0.95
hasattrFunction · 0.85
isinstanceFunction · 0.85

Tested by 2

test_class_markerMethod · 0.76
test_class_attrsMethod · 0.76