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.

classification
Title: test_urllib2net is run even when the network resource is disabled
Type: Stage:
Components: Tests Versions: Python 3.4
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: doko, python-dev, zach.ware
Priority: normal Keywords:

Created on 2013-12-26 15:32 by doko, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg206942 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-12-26 15:32
test_urllib2net is run even when the network resource is disabled, unlike test_urllibnet:

run_tests.py -j 1 -w -uall,-network,-urlfetch
...
[349/380/6] test_urllib2net
Resource 'http://www.python.org/' is not available
Resource 'http://www.example.com' is not available
Resource 'http://bitly.com/urllibredirecttest' is not available
Resource 'http://www.imdb.com' is not available
Resource 'http://docs.python.org/2/glossary.html#glossary' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
[350/380/6] test_urllib_response
[351/380/6] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
[352/380/6] test_urlparse
...
msg206945 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-12-26 16:06
this fixes it for me:

--- a/Lib/test/test_urllib2net.py	Wed Dec 25 17:36:20 2013 +0200
+++ b/Lib/test/test_urllib2net.py	Thu Dec 26 17:05:47 2013 +0100
@@ -14,6 +14,8 @@
 except ImportError:
     ssl = None
 
+support.requires("network")
+
 TIMEOUT = 60  # seconds
 
 
@@ -339,5 +341,4 @@
 
 
 if __name__ == "__main__":
-    support.requires("network")
     unittest.main()
msg206946 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-12-26 16:17
Looks good to me.
msg206947 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-26 16:37
New changeset e00bfb70a0c0 by doko in branch 'default':
- Issue #20070: Don't run test_urllib2net when network resources are not
http://hg.python.org/cpython/rev/e00bfb70a0c0
msg206949 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-12-26 17:59
fixed
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64269
2013-12-26 17:59:49dokosetstatus: open -> closed

messages: + msg206949
2013-12-26 16:37:32python-devsetnosy: + python-dev
messages: + msg206947
2013-12-26 16:17:43zach.waresetmessages: + msg206946
2013-12-26 16:06:25dokosetmessages: + msg206945
2013-12-26 15:32:34dokosetnosy: + zach.ware
2013-12-26 15:32:01dokocreate