summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-11 20:42:02 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-11 20:42:02 (GMT)
commitf054aeb2a1dadc752901f94852bea6242dec52bb (patch)
tree04e5e42f9eff08427ba173adbf00f615bece8567
parenta29fc29f1955ede4b495543bc8f07824db8f41a4 (diff)
downloadcpython-f054aeb2a1dadc752901f94852bea6242dec52bb.zip
cpython-f054aeb2a1dadc752901f94852bea6242dec52bb.tar.gz
cpython-f054aeb2a1dadc752901f94852bea6242dec52bb.tar.bz2
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address. By appending a period to the hostname, the hostname should only resolve to what we want it to resolve to. Hopefully this doesn't break different bots. Also add more info to failure message to aid debugging test failure.
-rw-r--r--Lib/test/test_urllib2net.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 8b13096..03b883b 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -160,8 +160,8 @@ class OtherNetworkTests(unittest.TestCase):
"urllib2$")
urls = [
# Thanks to Fred for finding these!
- 'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex',
- 'gopher://gopher.vt.edu:10010/10/33',
+ 'gopher://gopher.lib.ncsu.edu./11/library/stacks/Alex',
+ 'gopher://gopher.vt.edu.:10010/10/33',
]
self._test_urls(urls, self._extra_handlers())
@@ -239,7 +239,9 @@ class OtherNetworkTests(unittest.TestCase):
except (IOError, socket.error, OSError), err:
debug(err)
if expected_err:
- self.assert_(isinstance(err, expected_err))
+ msg = ("Didn't get expected error(s) %s for %s %s, got %s" %
+ (expected_err, url, req, err))
+ self.assert_(isinstance(err, expected_err), msg)
else:
buf = f.read()
f.close()
@@ -259,7 +261,6 @@ class OtherNetworkTests(unittest.TestCase):
return handlers
-
def test_main():
test_support.requires("network")
test_support.run_unittest(URLTimeoutTest, urlopenNetworkTests,