unittest -- simple question

Jp Calderone exarkun at intarweb.us
Sun Nov 2 16:43:17 CET 2003


On Sat, Nov 01, 2003 at 11:30:20PM -0500, Brian wrote:
> Hello;
> 
> I am writing my test modules that are separate from the modules they
> test. The test modules can be invoked with if __name__ == "__main__" when
> run from a command line. Right now, if __name__ == "__main__", the test
> module executes runTests(), which defines a suite of tests. From the
> module being tested, I am calling into the test module -- to the function
> runTests(), if __name__ == "__main__".
> 
> Is this how people make the tests executable from the module be tested?
> 

  I typically decorate my modules with the following preable:


    # -*- test-case-name: package.test.test_modulename -*-

  and then hit F9 when I want the tests to run.

  Jp





More information about the Python-list mailing list