Navbar:

Installing Testoob

Download your preferred distribution. If using the source distributions, read docs/INSTALL.

Getting Started

If you don’t already have any tests, build an empty test case:
# suite.py
import unittest
class MyTestCase(unittest.TestCase):
  def testFoo(self): pass
  def testBar(self): pass

To learn more about writing tests, see the tutorials in the links.

Running The Tests

On Unix systems, run the tests from the command-line like this:

prompt> testoob suite.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.002s
OK
prompt>
On Windows, find your Python installation directory. Let’s assume it’s c:\python. Then run:
prompt> python c:\python\scripts\testoob suite.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.003s
OK
prompt>
If you prefer, you can add the following at the end of the suite source file:
if __name__ == "__main__":
  import testoob
  testoob.main()
And then run the tests with:
prompt> python suite.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.002s
OK
prompt>

Running Your Own Test Suite

You can run test suites you created on your own.

If you have a function like:
def suite():
  result = unittest.TestSuite()
  # ...
  return result
You can run it by giving the function name:
prompt> testoob suite.py suite
You can also change the call to testoob.main:
if __name__ == "__main__":
  import testoob
  testoob.main(defaultTest="suite")