title: Can I patch a static method in python?
body: <p>I've a class in python that contains a static method. I want to <code>mock.patch</code> it in order to see if it was called. When trying to do it I get an error:
  <code>AttributeError: path.to.A does not have the attribute 'foo'</code></p>
  
  <p>My setup can be simplified to:</p>
  
  <pre><code>class A:
      @staticMethod
      def foo():
          bla bla
  </code></pre>
  
  <p>Now the test code that fails with error:</p>
  
  <pre><code>def test():
      with mock.patch.object("A", "foo") as mock_helper:
          mock_helper.return_value = ""
          A.some_other_static_function_that_could_call_foo()
          assert mock_helper.call_count == 1
  </code></pre>