[Python-checkins] r55197 - svn:log

Collin Winter collinw at gmail.com
Wed May 9 06:33:44 CEST 2007


On 5/8/07, Fred L. Drake, Jr. <fdrake at acm.org> wrote:
> On Wednesday 09 May 2007, collin.winter wrote:
>  > If the call to requires() doesn't precede the filesystem check, we get the
>  > following situation: 1. ./python Lib/test/regrtest.py test_foo # test
>  > needs urlfetch, not enabled, so skipped 2. ./python Lib/test/regrtest.py
>  > -u urlfetch test_foo # test runs 3. ./python Lib/test/regrtest.py test_foo
>  > # test runs (!)
>  >
>  > By moving the call to requires() *before* the filesystem check, the fact
>  > that fetched files are cached on the local disk becomes an implementation
>  > detail, rather than a semantics-changing point of note.
>
> Is this the intent of the requirement?  Or is the intent to protect the actual
> use of the network to perform the fetch?
>
> I think I understand your motivation, but it seems more important to protect
> against unintentional use of the network than to avoid running the tests.
> Running the tests when the needed resource is available seems like a good
> thing.

The network is still used to fetch the file the first time, and all
subsequent requests for the file will use the cached version from the
local disk. The behaviour change is that the presence of the
locally-cached file no longer removes the need to enable the urlfetch
resource; see http://mail.python.org/pipermail/python-dev/2007-April/072646.html
for the motivating case.

Collin Winter


More information about the Python-checkins mailing list