[Python-Dev] Using temp files and the Internet in regression tests

Guido van Rossum guido@python.org
Sun, 13 Apr 2003 20:55:18 -0400


> > No, you check whether the 'network' resource name is enabled in
> > test_support.  Use test_support.is_resource_enabled('network').
> 
> Another thought that has come to mind; should we be diligent about
> creating new objects like good testers?  Or should we minimize it since
> net connections are expensive to make and can hold things up.

Net connections aren't that expensive; you can happily create a new
net connection for each individual test.  Of course, tests that hold
things up should be minimized, but in my experience, tests containing
waits (even sleep(0.1)) hold things up much more than opening and
closing sockets.

--Guido van Rossum (home page: http://www.python.org/~guido/)