title: Testing Private Methods in Python: Unit Test or Functional Test?
body: <p>After reading about testing private methods in Python, specifically referring to <a href="https://stackoverflow.com/questions/2784519/how-do-i-unit-test-the-methods-in-a-method-object">this accepted answer</a>, it appears that it is best to just test the public interface. However, my class looks like this:</p>
  <pre><code>class MyClass:
  
    def __init__(self):
      # init code
  
    def run(self):
      self.__A()
      self.__B()
      self.__C()
      self.__D()
  
    def __A(self):
      # code for __A
  
    def __B(self):
      # code for __B
  
    def __C(self):
      # code for __C
  
    def __D(self):
      # code for __D
  </code></pre>
  <p>Essentially, I created a class to process some input data through a pipeline of functions. In this case, it would be helpful to test each private function in turn, without exposing them as public functions. How does one go about this, if a unit test can't execute the private function?</p>