How to monkeypatch buildin OPEN functions
<p>I need to write a test for a function that writes into a file as follows:</p>

<pre><code>with open(name=ccf.status_dir_path + '/' + script_normalized, mode='w') as outfile:
    outfile.write(str(datetime.datetime.now()))
</code></pre>

<p>Of course I would like to avoid the file to be created, so I need to monkeypatch "open", but since "open" doesn't belong to any class or module I do not know what to give as first parameter to </p>

<pre><code>monkeypatch.setattr(??, "open", patched_open)
</code></pre>