Yangyouxiu, I was recently trying to solve the same problem for my own project. Twisted apparently has some built-in testing facilities: http://twistedmatrix.com/documents/current/core/howto/trial.html Does this help at all?