title: How to test python local variables?
body: <p>So I have a monitor function that looks like:</p>
  
  <pre><code>def task1:
      // do some dummy work1
  def task2:
      // do some dummy work2
  def monitor:
    tasks = [task1, task2]
    while(true):
      sleep(1000)
      for task in tasks:
        task.run()
      if task1.alreadyRun():
         tasks.remove(task1)
  </code></pre>
  
  <p>I am wondering if there's way to do unit test by using some mock framework? Basically I want to make sure task1 was removed from the tasks list after it has been ran. However, I can't seem to figure out how to access local variables ie tasks here to determine its size in a mock framework. Thanks in advance for your help!</p>