def METHOD_NAME(monkeypatch):
    import tempfile
    @contextlib.contextmanager
    def fake_temporary_directory():
        yield "/tmp/somedir"
    monkeypatch.setattr(tempfile, "TemporaryDirectory", fake_temporary_directory)