title: How to supply stdin, files and environment variable inputs to Python unit tests?
body: <p>How to write tests where conditions like the following arise:</p>
  
  <ol>
  <li>Test user Input.</li>
  <li>Test input read from a file.</li>
  <li>Test input read from an environment variable.</li>
  </ol>
  
  <p>It'd be great if someone could show me how to approach the above mentioned scenarios; it'd still be awesome if you could point me to a few docs/articles/blog posts which I could
  read.</p>