summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2_localnet.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40275: Use new test.support helper submodules in tests (GH-21452)Hai Shi2020-08-041-3/+3
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-2/+3
|
* bpo-9216: hashlib usedforsecurity fixes (GH-20258)Christian Heimes2020-05-221-1/+1
| | | | | | | | | func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle strict security policy better. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)Hai Shi2020-04-291-1/+2
| | | Add a new test.support.hashlib_helper submodule.
* bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382)Christian Heimes2019-09-251-0/+1
| | | | | | | | | | | Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270
* bpo-37421: urllib.request tests call urlcleanup() (GH-14529)Victor Stinner2019-07-021-0/+3
| | | | | | | | urllib.request tests now call urlcleanup() to remove temporary files created by urlretrieve() tests and to clear the _opener global variable set by urlopen() and functions calling indirectly urlopen(). regrtest now checks if urllib.request._url_tempfiles and urllib.request._opener are changed by tests.
* 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
|