This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients brett.cannon, eric.araujo, ezio.melotti, nadeem.vawda, pitrou, python-dev
Date 2011-10-03.10:09:57
SpamBayes Score 0.0038264336
Marked as misclassified No
Message-id <1317636598.22.0.929523788925.issue12804@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW there's also support.open_urlresource that can be used to download test data.  open_urlresouce calls requires('urlfetch') and skips the test when the resource is not enabled.  For instance, test_normalization uses it:
try:
    testdata = support.open_urlresource(TESTDATAURL, encoding="utf-8",
                                        check=check_version)
except (IOError, HTTPException):
    self.skipTest("Could not retrieve " + TESTDATAURL)
self.addCleanup(testdata.close)

This also saves the file on the disk and reuses it when the test is run again, so the connection is actually used once and only if available.
History
Date User Action Args
2011-10-03 10:09:58ezio.melottisetrecipients: + ezio.melotti, brett.cannon, pitrou, nadeem.vawda, eric.araujo, python-dev
2011-10-03 10:09:58ezio.melottisetmessageid: <1317636598.22.0.929523788925.issue12804@psf.upfronthosting.co.za>
2011-10-03 10:09:57ezio.melottilinkissue12804 messages
2011-10-03 10:09:57ezio.melotticreate