[TIP] Writing Separate Functional Tests

Titus Brown titus at caltech.edu
Wed Nov 21 11:49:01 PST 2007

On Wed, Nov 21, 2007 at 09:35:40AM -0500, Noah Gift wrote:
-> I have a gigantic threaded beast I need to test, and I want to write  
-> functional tests that supplement the doctests and unittests, but  
-> wanted some advice on the proper way to do this.  I have not seen much  
-> documentation on writing non-web functional tests, my tool is a CLI  
-> tool. The basic thing I want to verify is that my tool creates a XML  
-> file with the information I would expect to be there.  For example, is  
-> there a selenium equivalent for command line tools?

Hey Noah,

something like texttest (or 'diff') seems like the simplest way to go.
You could also use one of the bajillion XML parsers to make assertions
about the contents of the XML file.

As for testing multithreaded code... well, as I've said in private,
that's even more difficult than *writing* multithreaded code.  You might
consider recording code coverage on a per-thread basis; I've been
thinking about how to do that and I might have a solution.  At the very
least it would tell you what your individual threads were doing.


More information about the testing-in-python mailing list