def test_command_raises_IpmiException_handling(self, monkeypatch): monkeypatch.setattr(IPMIDataFetcher, "open", lambda self: None) with pytest.raises(MKAgentError): with IPMIDataFetcher("127.0.0.1", "", "", logging.getLogger("tests")): raise IpmiException()
def open_(*args): raise IpmiException()