title: Python: Unit test of a function not returning anything, but changing state of the object
body: <p>I have a function that doesn't return any value, but changes the internal state of its object. E.g.:</p>
  
  <pre><code>class A(object):
      def __init__(self):
          self._status = None
  
      def doSomethingThatResultsInChangingStatus(self):
          ...do some computing...
          self._status = newStatus
  </code></pre>
  
  <p>The <code>_status</code> instance variable is meant to be private, so even though Python technically lets me check its status after the function call, I feel that I shouldn't be doing that. The way I am checking it now is by having a getter function for the <code>_status</code> variable, but that's fundamentally similar to checking the private variable directly. What is the proper way to test this kind of function?</p>