MCPcopy
hub / github.com/pytest-dev/pytest / test_safe_getattr

Function test_safe_getattr

testing/test_compat.py:103–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102
103def test_safe_getattr() -> None:
104 helper = ErrorsHelper()
105 assert safe_getattr(helper, "raise_exception", "default") == "default"
106 assert safe_getattr(helper, "raise_fail_outcome", "default") == "default"
107 with pytest.raises(BaseException): # noqa: B017
108 assert safe_getattr(helper, "raise_baseexception", "default")
109
110
111def test_safe_isclass() -> None:

Callers

nothing calls this directly

Calls 2

safe_getattrFunction · 0.90
ErrorsHelperClass · 0.85

Tested by

no test coverage detected