title: Is there a way to get python's nose module to work the same in __main__ and on the command line?
body: <p>I'm not sure of how to get the nose module's <code>__main__</code> handler to work. I have this at the end of my test module:</p>
  
  <pre><code>if __name__ == "__main__":
      import nose
      nose.main()
  </code></pre>
  
  <p>Which gives me:</p>
  
  <pre><code>----------------------------------------------------------------------
  Ran 0 tests in 0.002s
  
  OK
  </code></pre>
  
  <p>but it I run the same thing via the command line, it finds the tests and executes them:</p>
  
  <pre><code>MacBook-Pro:Storage_t meloam$nosetests FileManager_t.py 
  ............E..
  ======================================================================
  ERROR: testStageOutMgrWrapperRealCopy (WMCore_t.Storage_t.FileManager_t.TestFileManager)
  ----------------------------------------------------------------------
  </code></pre>
  
  <p>SNIP</p>
  
  <pre><code>----------------------------------------------------------------------
  Ran 15 tests in 0.082s
  
  FAILED (errors=1)
  </code></pre>
  
  <p>I've been playing with passing different arguments to nose.main() but I can't find anything that works. Am I missing something really obvious?</p>
  
  <p>Thanks</p>