title: Pytest test file that reads from current directory
body: <p>I am trying to do a unit test with Pytest on a function of the form</p>
  <pre class="lang-py prettyprint-override"><code>def function():
      with open('file.txt', 'r') as file:
          # read for information in file
      return information_from_file
  </code></pre>
  <p>I want to make a temporary directory which I can use the function to read from. This lead me to using <code>tmpdir</code> and <code>tmpdir_factory</code>, however both these options require that a path object is inputted as an argument from what I can tell. Though in this case, that isn't an option since the function is reading from the current directory rather than a directory that was inputted.</p>
  <p>Is there a way to use Pytest in order to do a test on this kind of function?</p>