[New-bugs-announce] [issue22478] tests for urllib2net are in bad shapes
karl
report at bugs.python.org
Wed Sep 24 09:49:29 CEST 2014
New submission from karl:
→ ./python.exe -V
Python 3.4.2rc1+
→ hg tip
changeset: 92532:6dcc96fa3970
tag: tip
parent: 92530:ad45c2707006
parent: 92531:8eb4eec8626c
user: Benjamin Peterson <benjamin at python.org>
date: Mon Sep 22 22:44:21 2014 -0400
summary: merge 3.4 (#22459)
When working on issue #5550, I realized that some tests are currently failing.
Here the log of running:
→ ./python.exe -m unittest -v Lib/test/test_urllib2net.py
test_close (Lib.test.test_urllib2net.CloseSocketTest) ... ok
test_custom_headers (Lib.test.test_urllib2net.OtherNetworkTests) ... FAIL
test_file (Lib.test.test_urllib2net.OtherNetworkTests) ... test_ftp (Lib.test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC/research-reports/00README-Legal-Rules-Regs' is not available"
test_redirect_url_withfrag (Lib.test.test_urllib2net.OtherNetworkTests) ... ok
test_sites_no_connection_close (Lib.test.test_urllib2net.OtherNetworkTests) ... ok
test_urlwithfrag (Lib.test.test_urllib2net.OtherNetworkTests) ... ok
test_ftp_basic (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_ftp_default_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_ftp_no_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_ftp_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_http_basic (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_http_default_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_http_no_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
test_http_timeout (Lib.test.test_urllib2net.TimeoutTest) ... ok
======================================================================
ERROR: test_file (Lib.test.test_urllib2net.OtherNetworkTests) (url='file:/Users/karl/code/cpython/%40test_61795_tmp')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 243, in _test_urls
f = urlopen(url, req, TIMEOUT)
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 33, in wrapped
return _retry_thrice(func, exc, *args, **kwargs)
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 23, in _retry_thrice
return func(*args, **kwargs)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 447, in open
req = Request(fullurl, data)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 267, in __init__
origin_req_host = request_host(self)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 250, in request_host
host = _cut_port_re.sub("", host, 1)
TypeError: expected string or buffer
======================================================================
ERROR: test_file (Lib.test.test_urllib2net.OtherNetworkTests) (url=('file:///nonsensename/etc/passwd', None, <class 'urllib.error.URLError'>))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 243, in _test_urls
f = urlopen(url, req, TIMEOUT)
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 33, in wrapped
return _retry_thrice(func, exc, *args, **kwargs)
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 23, in _retry_thrice
return func(*args, **kwargs)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 447, in open
req = Request(fullurl, data)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 267, in __init__
origin_req_host = request_host(self)
File "/Users/karl/code/cpython/Lib/urllib/request.py", line 250, in request_host
host = _cut_port_re.sub("", host, 1)
TypeError: expected string or buffer
======================================================================
FAIL: test_custom_headers (Lib.test.test_urllib2net.OtherNetworkTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/karl/code/cpython/Lib/test/test_urllib2net.py", line 186, in test_custom_headers
self.assertEqual(request.get_header('User-agent'), 'Test-Agent')
AssertionError: 'Python-urllib/3.4' != 'Test-Agent'
- Python-urllib/3.4
+ Test-Agent
----------------------------------------------------------------------
Ran 16 tests in 124.879s
FAILED (failures=1, errors=2, skipped=1)
----------
components: Tests
messages: 227417
nosy: karlcow
priority: normal
severity: normal
status: open
title: tests for urllib2net are in bad shapes
versions: Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22478>
_______________________________________
More information about the New-bugs-announce
mailing list