title: How to replace variable inside function in unittest- pytest
body: <p>I have a problem with replace variable inside method which i have to test, namely:</p>
  
  <pre><code>def find_files(path):
      path_dir = os.listdir(path)
      ...
  </code></pre>
  
  <p>and for needs of test I have to replace <code>path_dir</code> from real result of <code>os.listdir</code> to some test list i.e. <code>['whatever1.txt', 'whatever2.txt', 'whatever3.txt']</code></p>
  
  <p>How to do it?
  BR, Damian</p>