title: How to test a function asking for user input in Python
body: <p>I would like to test the following Python function using pytest:</p>
  <pre><code>def increase_by_one()
      n = int(input())
      return n + 1
  </code></pre>
  <p>How can I write to the stdin/user input request within a function, for testing purposes?</p>