[Python-Dev] Using temp files and the Internet in regression tests (original) (raw)

Brett Cannon drifty@alum.berkeley.edu
Sun, 13 Apr 2003 12:50:39 -0700 (PDT)


[Guido van Rossum]

> > Connecting to the Internet: only if the network resource is enabled. > > Then it is up to the tester to make sure that connection to the > > Internet is possible. > > Any suggestions on how to go about this? An initial connection to > python.org after setting socket.setdefaulttimeout() to something > reasonable (like 10 seconds?) and raising testsupport.TestSkipped if it > times out?

No, you check whether the 'network' resource name is enabled in testsupport. Use testsupport.isresourceenabled('network').

Actually I knew that. What I was wondering about was how "to make sure that connection to Internet is possible".

-Brett