using PyUnit to test with multiple threads

winston.yang at netrics.com winston.yang at netrics.com
Wed Mar 28 10:52:31 EDT 2007


Is it possible to use PyUnit to test with multiple threads?

I want to send many commands to a database at the same time. The order
of execution of the commands is indeterminate, and therefore, so is
the status message returned.

For example, say that I send the commands "get" and "delete" for a
given record to the database at the same time. If the get executes
before the delete, I expect a success message (assuming that the
record exists in the database). If the delete executes before the get,
I expect a failure message.

Is there a way to write tests in PyUnit for this type of situation?

Thank you in advance.

Winston




More information about the Python-list mailing list