title: Using IDLE to run Python PyUnit unit tests
body: <p>Is there a way, within IDLE, to run the PyUnit (unittest module) unit tests directly?</p>
  
  <p>I ask because I have a short test module and when I run it with python mymodule.py from the Cygwin shell I get all tests passed, but when I use Run->Run Module from IDLE the tests pass but then I get an exception (SystemExit: False).</p>
  
  <p>For example, here is a sample test module to reproduce this:</p>
  
  <pre><code>#!/usr/bin/python
  
  import unittest
  
  class fooTests(unittest.TestCase):
  
      def setUp(self):
          self.foo = "bar"
  
      def testDummyTest(self):
          self.assertTrue(True)
  
      def testDummyTestTwo(self):
          self.assertEquals("foo", "foo")
  
  
      def tearDown(self):
          self.foo = None
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>When I run this from the Cygwin shell with python fooTests.py it produces:</p>
  
  <pre><code>$ python fooTests.py
  ..
  ----------------------------------------------------------------------
  Ran 2 tests in 0.000s
  
  OK
  </code></pre>
  
  <p>But when I'm editing fooTests.py within IDLE and I do Run -> Run Module, the new Python Shell spawned by IDLE produces:</p>
  
  <pre><code>&gt;&gt;&gt; ================================ RESTART ================================
  &gt;&gt;&gt; 
  ..
  ----------------------------------------------------------------------
  Ran 2 tests in 0.031s
  
  OK
  
  Traceback (most recent call last):
    File "C:\Some\path\info\I\shortened\fooTests.py", line 20, in &lt;module&gt;
      unittest.main()
    File "C:\Python26\lib\unittest.py", line 817, in __init__
      self.runTests()
    File "C:\Python26\lib\unittest.py", line 865, in runTests
      sys.exit(not result.wasSuccessful())
  SystemExit: False
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>What am I doing wrong, to produce this traceback, and especially how can I fix it so that I can just do Run->Run Module (or F5) within IDLE to run the unit tests quickly?</p>
  
  <p>(This surely must be a simple question, but my quick attempts to figure it out have proven fruitless.)</p>