monkeypatch logging basicConfig with pytest I have a function that that involves setting up a logger: