[Tutor] Does unittest slow down code

Kent Johnson kent37 at tds.net
Mon Aug 4 17:53:14 CEST 2008


On Mon, Aug 4, 2008 at 11:32 AM, Tomaz Bevec <tomazbevec at yahoo.com> wrote:
>
> Is code executed within a unit test significantly slower than code executed outside of a unit test?  Does code executed within a unit test take up more memory?

Assuming you are asking about the unittest module...No, not unless you
do something specific in the unit test, e.g. testing on a large data
set would take more memory.

Unittest just runs the code you tell it to and looks at the result. It
doesn't instrument the code in any way. You do have to load the actual
unittest module but I don't think it has any great memory
requirements.

Are you seeing this behaviour or just asking about it?

Kent


More information about the Tutor mailing list