summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2_localnet.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-051-16/+12
|
* bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)Bradley Laney2018-07-101-1/+1
| | | Contributed by Bradley Laney.
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-1/+1
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)Christian Heimes2017-09-151-1/+1
| | | | | | Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-5/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* test_urllib2_localnet: clear server variable (#2510)Victor Stinner2017-06-301-4/+13
| | | | Set the server attribute to None in cleanup to avoid dangling threads.
* support.threading_cleanup() log a warning on fail (#1195)Victor Stinner2017-04-201-1/+1
| | | | | | | | | | | | The @reap_threads decorator and the threading_cleanup() function of test.support now log a warning if they fail to clenaup threads. Fix also the usage of support.threading_cleanup() in test_urllib2_localnet. The log may help to debug such other warning seen on the AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot: Warning -- threading._dangling was modified by test_logging
* Issue #28435: Merge urllib test fixes from 3.5 into 3.6Martin Panter2016-10-221-0/+9
|\
| * Issue #28435: Avoid no_proxy environment variable interfering with testsMartin Panter2016-10-221-0/+9
| | | | | | | | Patch by Piotr Szczepaniak.
| * Issue #26620: Fix ResourceWarning in test_urllib2_localnetMartin Panter2016-10-221-21/+18
| | | | | | | | | | | | | | | | * Use context manager on urllib objects to ensure that they are closed on error * Use self.addCleanup() to cleanup resources even if a test is interrupted with CTRL+c This backports a patch by Victor Stinner.
* | Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-16/+18
| | | | | | | | | | | | | | The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
* | Closes #26620: Fix ResourceWarning in test_urllib2_localnetVictor Stinner2016-03-241-21/+18
|/ | | | | | * Use context manager on urllib objects to ensure that they are closed on error * Use self.addCleanup() to cleanup resources even if a test is interrupted with CTRL+c
* Issue #23788: Merge redundant test_bad_address() into test_urllibnetMartin Panter2015-12-161-29/+0
| | | | | | | In Python 2, these were duplicated; one for urllib.urlopen() and one for urllib2.urlopen(). The test_urllibnet version has a better precondition to avoid false failures with bad DNS, and the test_urllib2_localnet version had a more up-to-date comment and domain name.
* remove extra ssl imports (closes #23053)Benjamin Peterson2014-12-151-1/+0
| | | | Patch from Jan Matejek.
* PEP 476: enable HTTPS certificate verification by default (#22417)Benjamin Peterson2014-11-031-2/+4
| | | | Patch by Alex Gaynor with some modifications by me.
* Fix issue22245 - Fix urllib2_localnet test.Senthil Kumaran2014-08-221-1/+0
| | | | Do not aggresively close wfile in the do_GET method in the BasicAuthHandler.
* Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. ↵Senthil Kumaran2014-08-201-0/+83
| | | | Initial patch by Sam Bull.
* backout changeset 3435c5865cfc due to buildbot failures. Ref #8797Senthil Kumaran2014-08-161-83/+0
|
* Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. ↵Senthil Kumaran2014-08-161-0/+83
| | | | Initial patch by Sam Bull.
* Run test_urllib2_localnet tests using unittest.main().Senthil Kumaran2014-04-151-7/+17
| | | | Capture threads in the setUpModule and cleanup threads in the tearDownModule.
* Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-2/+0
|\ | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang lines in the unittestgui and checkpip scripts.
| * Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-2/+0
| | | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang line to use python3 executable in the unittestgui script.
| * Cleanup this test's modification of os.environ in teardown (this alreadyGregory P. Smith2013-11-181-0/+3
| | | | | | | | exists in 3.4 but apparently wasn't done for 3.3).
* | #17564: merge with 3.3.Ezio Melotti2013-03-291-0/+5
|\ \ | |/
| * #17564: skip test_bad_address unless the tests are run with -unetwork/-uall.Ezio Melotti2013-03-291-0/+5
| |
* | Issue #17107: Test client-side SNI support in urllib.request thanks to the ↵Antoine Pitrou2013-02-051-3/+25
| | | | | | | | | | | | new server-side SNI support in the ssl module. Initial patch by Daniel Black.
* | Issue #16702: Skip proxies for localhost in urllib2_localnet testsSenthil Kumaran2012-12-261-0/+2
|\ \ | |/
| * Issue #16702: Skip proxies for localhost in urllib2_localnet testsSenthil Kumaran2012-12-261-0/+2
| |\
| | * Issue #16702: Skip proxies for localhost in urllib2_localnet testsSenthil Kumaran2012-12-261-0/+2
| | |
* | | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-1/+1
|/ /
* | Issue #14780: urllib.request.urlopen() now has a `cadefault` argument to use ↵Antoine Pitrou2012-05-161-0/+7
|/ | | | | | the default certificate store. Initial patch by James Oakley.
* Issue #10250: fix resource warnings in test_urllib2_localnet. Patch by ↵Antoine Pitrou2010-10-301-0/+1
| | | | Brian Brazil.
* Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler andAntoine Pitrou2010-10-131-13/+48
| | | | | urllib.request.urlopen now take optional arguments to allow for server certificate checking, as recommended in public uses of HTTPS.
* Add test case for the HTTPResponse being an iterable. Follow-up of issue #4608.Florent Xicluna2010-08-081-2/+22
|
* Use unittest specific methods for some urllib test cases. And replace ↵Florent Xicluna2010-08-081-11/+11
| | | | urllib2 with urllib.request in comments.
* Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge fromVictor Stinner2010-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines Issue #7449, part 1: fix test_support.py for Python compiled without thread ........ r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line Issue #7449, part 2: regrtest.py -j option requires thread support ........ r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines Issue #7449 part 3, test_doctest: import trace module in test_coverage() Import trace module fail if the threading module is missing. test_coverage() is only used if test_doctest.py is used with the -c option. This commit allows to execute the test suite without thread support. Move "import trace" in test_coverage() and use test_support.import_module('trace'). ........ r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines Issue #7449, part 4: skip test_multiprocessing if thread support is disabled import threading after _multiprocessing to raise a more revelant error message: "No module named _multiprocessing". _multiprocessing is not compiled without thread support. ........ r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py * Split Test.test_open() in 2 functions: test_open() and test_thread_open() * Skip test_open() and test_thread_open() if we are unable to find the C library * Skip test_thread_open() if thread support is disabled * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError() ........ r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 6: fix test_hashlib for missing threading module Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing(). ........ r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 7: simplify threading detection in test_capi * Skip TestPendingCalls if threading module is missing * Test if threading module is present or not, instead of test the presence of _testcapi._test_thread_state ........ r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing TestFifo can be executed without the threading module ........ r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 9: fix test_xmlrpclib for missing threading module * Skip testcases using threads if threading module is missing * Use "http://" instead of URL in ServerProxyTestCase if threading is missing because URL is not set in this case ........ r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines Partial revert of r80556 (Issue #7449, part 5, fix ctypes test) Rewrite r80556: the thread test have to be executed just after the test on libc_open() and so the test cannot be splitted in two functions (without duplicating code, and I don't want to duplicate code). ........ r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 10: test_cmd imports trace module using test_support.import_module() Use test_support.import_module() instead of import to raise a SkipTest exception if the import fail. Import trace fails if the threading module is missing. See also part 3: test_doctest: import trace module in test_coverage(). ........ r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, last part (11): fix many tests if thread support is disabled * Use try/except ImportError or test_support.import_module() to import thread and threading modules * Add @unittest.skipUnless(threading, ...) to testcases using threads ........
* Merged revisions 79100 via svnmerge fromFlorent Xicluna2010-03-191-2/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79100 | florent.xicluna | 2010-03-19 19:34:55 +0100 (ven, 19 mar 2010) | 2 lines Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* and setUp/tearDown. ........
* convert shebang lines: python -> python3Benjamin Peterson2010-03-111-1/+1
|
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* Merged revisions 75855 via svnmerge fromAntoine Pitrou2009-10-271-2/+10
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75855 | antoine.pitrou | 2009-10-27 21:14:04 +0100 (mar., 27 oct. 2009) | 3 lines Fix transient refleaks in test_urllib2_localnet. ........
* Merged revisions 75111 via svnmerge fromR. David Murray2009-09-291-7/+18
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75111 | r.david.murray | 2009-09-28 12:57:45 -0400 (Mon, 28 Sep 2009) | 5 lines Prevent test_bad_address failure when a domain in the dns search path implements a '*' default rule. Also update comment with a more complete explanation of the difficulties inherent in the test. ........
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-3/+3
|
* Merged revisions 72777 via svnmerge fromCollin Winter2009-05-181-17/+21
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72777 | collin.winter | 2009-05-18 14:35:40 -0700 (Mon, 18 May 2009) | 1 line Issue 6032: fix refleaks in test_urllib2_localnet. ........
* Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding.Antoine Pitrou2009-02-111-5/+27
|
* Merged revisions 67777,67779 via svnmerge fromAntoine Pitrou2008-12-151-1/+1
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r67777 | antoine.pitrou | 2008-12-14 23:33:55 +0100 (dim., 14 déc. 2008) | 3 lines try to fix failure in test_bad_address on some buildbots ........ r67779 | antoine.pitrou | 2008-12-15 01:39:51 +0100 (lun., 15 déc. 2008) | 1 line modify other occurrence of test_bad_address ........
* Make a new urllib package .Jeremy Hylton2008-06-181-108/+77
| | | | | | | | | | | | | It consists of code from urllib, urllib2, urlparse, and robotparser. The old modules have all been removed. The new package has five submodules: urllib.parse, urllib.request, urllib.response, urllib.error, and urllib.robotparser. The urllib.request.urlopen() function uses the url opener from urllib2. Note that the unittests have not been renamed for the beta, but they will be renamed in the future. Joint work with Senthil Kumaran.
* Patch for issue 2848, mostly by Humberto Diogenes, with a couple ofBarry Warsaw2008-06-121-4/+4
| | | | small fixes by Barry. This removes mimetools from the stdlib.
* Create http package. #2883.Georg Brandl2008-05-261-8/+8
|
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-4/+4
|
* Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge fromChristian Heimes2008-03-281-1/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r61981 | amaury.forgeotdarc | 2008-03-28 01:21:34 +0100 (Fri, 28 Mar 2008) | 2 lines test_future3.py is a regular test file, and should be part of the test suite ........ r61984 | jeffrey.yasskin | 2008-03-28 05:11:18 +0100 (Fri, 28 Mar 2008) | 6 lines Kill a race in test_threading in which the exception info in a thread finishing up after it was joined had a traceback pointing to that thread's (deleted) target attribute, while the test was trying to check that the target was destroyed. Big thanks to Antoine Pitrou for diagnosing the race and pointing out sys.exc_clear() to kill the exception early. This fixes issue 2496. ........ r61985 | neal.norwitz | 2008-03-28 05:41:34 +0100 (Fri, 28 Mar 2008) | 1 line Allow use of other ports so the test can pass if 9091 is in use ........ r61986 | jeffrey.yasskin | 2008-03-28 05:53:10 +0100 (Fri, 28 Mar 2008) | 2 lines Print more information the next time test_socket throws the wrong exception. ........ r61987 | neal.norwitz | 2008-03-28 05:58:51 +0100 (Fri, 28 Mar 2008) | 5 lines Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings. Rather than sprinkle casts throughout the code, change Py_CHARMASK to always cast it's result to an unsigned char. This should ensure we do the right thing when accessing an array with the result. ........ r61992 | neal.norwitz | 2008-03-28 06:34:59 +0100 (Fri, 28 Mar 2008) | 2 lines Fix compiler warning about finite() missing on Solaris. ........ r61993 | neal.norwitz | 2008-03-28 07:34:03 +0100 (Fri, 28 Mar 2008) | 11 lines Bug 1503: Get the test to pass on OSX. This should make the test more reliable, but I'm not convinced it is the right solution. We need to determine if this causes the test to hang on any platforms or do other bad things. Even if it gets the test to pass reliably, it might be that we want to fix this in socket. The socket returned from accept() is different on different platforms (inheriting attributes or not) and we might want to ensure that the attributes (at least blocking) is the same across all platforms. ........ r61997 | neal.norwitz | 2008-03-28 08:36:31 +0100 (Fri, 28 Mar 2008) | 1 line Name the main method correctly so the test is run ........ r61998 | gregory.p.smith | 2008-03-28 09:00:44 +0100 (Fri, 28 Mar 2008) | 7 lines This patch moves some tests from test_urllib2_net to test_urllib2_localnet. The moved tests use a local server rather than going out to external servers. Accepts patch from issue2429. Contributed by Jerry Seutter & Michael Foord (fuzzyman) at PyCon 2008. ........ r61999 | georg.brandl | 2008-03-28 09:06:56 +0100 (Fri, 28 Mar 2008) | 2 lines #2406: add examples to gzip docs. ........ r62000 | gregory.p.smith | 2008-03-28 09:32:09 +0100 (Fri, 28 Mar 2008) | 4 lines Accept patch issue2426 by Paul Kippes (kippesp). Adds sqlite3.Connection.iterdump to allow dumping of databases. ........