classification
Title: test_urllib2net fails
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: open Resolution: duplicate
Dependencies: Superseder: test_urlwithfrag fail
View: 16969
Assigned To: Nosy List: ddvento@ucar.edu, ezio.melotti, ned.deily, r.david.murray
Priority: normal Keywords:

Created on 2013-02-08 16:45 by ddvento@ucar.edu, last changed 2014-04-15 19:32 by ddvento@ucar.edu.

Messages (7)
msg181682 - (view) Author: (ddvento@ucar.edu) Date: 2013-02-08 16:45
test_urllib2net fails as follows. Looking at test_urllib2net.py" line 165 does not reveal anything interesting to me

./python Lib/test/regrtest.py -uall -v test_urllib2net
== CPython 2.7.3 (default, Feb 8 2013, 08:28:21) [GCC 4.7.2]
==   Linux-2.6.32-220.13.1.el6.x86_64-x86_64-with-redhat-6.2-Santiago little-endian
==   /glade/scratch/ddvento/build/Python-2.7.3-westmere/build/test_python_7544
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
test_urllib2net
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... ok
test_file (test.test_urllib2net.OtherNetworkTests) ... ok
test_fileno (test.test_urllib2net.OtherNetworkTests) ... ok
test_ftp (test.test_urllib2net.OtherNetworkTests) ... ok
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... ok
test_urlwithfrag (test.test_urllib2net.OtherNetworkTests) ... FAIL
test_close (test.test_urllib2net.CloseSocketTest) ... ok
test_ftp_basic (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_basic (test.test_urllib2net.TimeoutTest) ... ok
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_timeout (test.test_urllib2net.TimeoutTest) ... ok

======================================================================
FAIL: test_urlwithfrag (test.test_urllib2net.OtherNetworkTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/glade/scratch/ddvento/build/Python-2.7.3-westmere/Lib/test/test_urllib2net.py", line 165, in test_urlwithfrag
    "http://docs.python.org/glossary.html#glossary")
AssertionError: 'http://docs.python.org/2/glossary.html' != 'http://docs.python.org/glossary.html#glossary'

----------------------------------------------------------------------
Ran 15 tests in 14.684s

FAILED (failures=1)
test test_urllib2net failed -- Traceback (most recent call last):
  File "/glade/scratch/ddvento/build/Python-2.7.3-westmere/Lib/test/test_urllib2net.py", line 165, in test_urlwithfrag
    "http://docs.python.org/glossary.html#glossary")
AssertionError: 'http://docs.python.org/2/glossary.html' != 'http://docs.python.org/glossary.html#glossary'

1 test failed:
    test_urllib2net
msg181683 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-08 17:07
It passes on all our buildbots, and for me locally.  Is it possible there is a proxy server between you and python.org that is changing the url returned?
msg181685 - (view) Author: (ddvento@ucar.edu) Date: 2013-02-08 17:21
Yes, it is possible, do you want me to investigate more with my network 
people?
msg181686 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-08 17:27
I think only if you want to.  As far as we are concerned the test is correct and passing.  (And this kind of thing is the reason that that test set is only run when -uall is specified.)

I'm going to close the issue.  If you do investigate, and feel that you've found a real bug, please reopen it.
msg181691 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-02-08 18:46
The test is failing because of a restructuring of the docs.python.org website.  The test was changed on 2012-10-28 to use the new URL (923ca6d73bad and friends).  That change will be in the next set of maintenance releases including 2.7.4 real soon now.
msg182096 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-02-14 13:36
See also #16969.
msg216369 - (view) Author: (ddvento@ucar.edu) Date: 2014-04-15 19:32
Reopening, since this is still broken in Python 2.7.6

I wonder why do we have to use real websites instead of mocks for this test. And if there are really really really really good reasons, if we can use example.com instead as in issue #20939 (maybe that is more stable than python.org)
History
Date User Action Args
2014-04-15 19:32:10ddvento@ucar.edusetstatus: closed -> open

messages: + msg216369
2013-02-14 13:36:13ezio.melottisetnosy: + ezio.melotti
messages: + msg182096
resolution: out of date -> duplicate

type: behavior
superseder: test_urlwithfrag fail
2013-02-08 18:46:47ned.deilysetresolution: works for me -> out of date

messages: + msg181691
nosy: + ned.deily
2013-02-08 17:27:20r.david.murraysetstatus: open -> closed
resolution: works for me
messages: + msg181686

stage: resolved
2013-02-08 17:21:56ddvento@ucar.edusetmessages: + msg181685
2013-02-08 17:07:20r.david.murraysetnosy: + r.david.murray
messages: + msg181683
2013-02-08 16:45:53ddvento@ucar.educreate