title: Cannot mock subprocess.check_call
body: <p>I want to write a test for this function while mocking <code>check_call</code> (I don't want it to be called):</p>
  <pre><code>from subprocess import check_call
  
  def foo_method():
      check_call([&quot;ls&quot;])
      print(&quot;hello&quot;)
  </code></pre>
  <p>This is the test:</p>
  <pre><code>import unittest.mock
  from scripts import foo_method
  
  @unittest.mock.patch(&quot;subprocess.check_call&quot;)
  def test_foo_method(subprocess_check_call):
      foo_method()
  </code></pre>
  <p>But the <code>check_call</code> function is always called and is not mocked. What is wrong with the test?</p>