]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Fix a bug in test.test_support.open_urlresource().
authorCollin Winter <collinw@gmail.com>
Wed, 9 May 2007 04:14:36 +0000 (04:14 +0000)
committerCollin Winter <collinw@gmail.com>
Wed, 9 May 2007 04:14:36 +0000 (04:14 +0000)
commitfa9be8c289a963bbd626c452b7c0a2ddde12a7ef
treee2d4819cbe6d3e41d7e5b126caecd6b1d475bd25
parentabe1d48d2068ef0fea36a9b370a8b159ab267430
Fix a bug in test.test_support.open_urlresource().

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.
Lib/test/test_support.py