summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33937: Catch ENOMEM error in test_socket (GH-9557)Miss Islington (bot)2018-09-251-2/+13
| | | | | | | | Fix test_socket.SendmsgSCTPStreamTest: catch ENOMEM error. testSendmsgTimeout() and testSendmsgDontWait() randomly fail on Travis CI with: "OSError: [Errno 12] Cannot allocate memory". (cherry picked from commit 46f40be8b907854deb81c6132b7cb038e9e5202a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.6] bpo-34582: Update syntax of Azure Pipelines builds (GH-9521) (GH-9528)Steve Dower2018-09-241-6/+17
| | | https://bugs.python.org/issue34582
* [3.6] bpo-17239: Disable external entities in SAX parser (GH-9217) (GH-9512)Christian Heimes2018-09-243-2/+78
| | | | | | | | | | | | | | | | | The SAX parser no longer processes general external entities by default to increase security. Before, the parser created network connections to fetch remote files or loaded local files from the file system for DTD and entities. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue17239. (cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue17239
* [3.6] bpo-34670: Add TLS 1.3 post handshake auth (GH-9460) (GH-9507)Christian Heimes2018-09-231-0/+207
| | | | | | | | | | | | | | | | Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <christian@python.org>q https://bugs.python.org/issue34670. (cherry picked from commit 9fb051f032c36b9f6086b79086b4d6b7755a3d70) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue34670
* Fixes tests requiring extra environment values on Windows (GH-9463)Steve Dower2018-09-204-89/+112
|
* bpo-19756: Prevent test failures due to EADDRNOTAVAIL (GH-9446)Miss Islington (bot)2018-09-201-0/+3
| | | | | (cherry picked from commit 8213eaddf3ce8e87564d2949454903a1484748b5) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* [3.6] bpo-34542: Update test certs and keys (GH-8997) (GH-9396)Christian Heimes2018-09-2017-576/+787
| | | | | | | | | | | | | Update all test certs and keys to use future proof crypto settings: * 3072 bit RSA keys * SHA-256 signature Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit e6dac0077996b1e1f886f036d6f2606237fa4c85) https://bugs.python.org/issue34542
* bpo-34582: Adds JUnit XML output for regression tests (GH-9210)Miss Islington (bot)2018-09-188-30/+298
| | | | | (cherry picked from commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-34587, test_socket: remove RDSTest.testCongestion() (GH-9277)Miss Islington (bot)2018-09-171-27/+0
| | | | | | | | | | | | The test tries to fill the receiver's socket buffer and expects an error. But the RDS protocol doesn't require that. Moreover, the Linux implementation of RDS expects that the producer of the messages reduces its rate, it's not the role of the receiver to trigger an error. The test fails on Fedora 28 by design, so remove it. (cherry picked from commit 7484bdfd1e2e33fdd2c44dd4ffa044aacd495337) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)Miss Islington (bot)2018-09-171-0/+14
| | | | | (cherry picked from commit 9bdb7be482aef8f60daa1d36606568a132dcb616) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113)Miss Islington (bot)2018-09-171-0/+23
| | | | | (cherry picked from commit e0e5065daef36dafe10a46eaa8b7800274d73062) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-31132: Remove prlimit permission test. (GH-9280)Miss Islington (bot)2018-09-131-3/+0
| | | | | | | | This test is doesn't work when the test process is privledged, which is hard to detect. https://bugs.python.org/issue34668 (cherry picked from commit 01e0afa994c2e840f85e2de103e72a2c0ddf1b1f) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-34661: Fix test skipping call. (GH-9266)Miss Islington (bot)2018-09-131-1/+1
| | | | | (cherry picked from commit e78734d579439861f6d7e12f35d268836b2c1e24) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* closes bpo-34661: Fix test_shutil if unzip doesn't support -t. (GH-9262)Miss Islington (bot)2018-09-131-0/+2
| | | | | (cherry picked from commit a710ebd21b09efe902dde84d4862ce5c6427f7af) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-34200: Fix non-determinism of test_pkg (GH-9248)Miss Islington (bot)2018-09-131-8/+9
| | | | | | | | This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code. https://bugs.python.org/issue34200 (cherry picked from commit 4ae8ece5cd4c5853b625381db13429f25512108d) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)Miss Islington (bot)2018-09-131-3/+3
| | | | | (cherry picked from commit e1a34ceb541ef87e03bb428630097dacc9c658e5) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.6] closes bpo-34650: Check if sched_getscheduler returns ENOSYS before ↵Benjamin Peterson2018-09-121-1/+13
| | | | | | | | declaring it supported. (GH-9237) musl doesn't support the scheduler API, but declares stubs that alway return ENOSYS.. (cherry picked from commit c7042224b8a67748f125c22836862483f81a87a6) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* closes bpo-34004: Skip lock interruption tests on musl. (GH-9224)Miss Islington (bot)2018-09-121-0/+8
| | | | | | | | | | | | | | Returning EINTR from pthread semaphore or lock acquisition is an optional POSIX feature. musl does not provide this feature, so some threadsignal tests fail when Python is built against it. There's no good way to test for musl, so we skip if we're on Linux and not using glibc pthreads. Also, hedge in the threading documentation about when we can provide interrupts from lock acquisition. (cherry picked from commit 5b10d5111d7a855297654af9045f8907b7d3dd08) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.6] closes bpo-31608: Fix a crash in methods of a subclass of ↵Benjamin Peterson2018-09-111-0/+15
| | | | | | | _collections.deque with a bad __new__(). (GH-9178) (cherry picked from commit 24bd50bdcc97d65130c07d6cd26085fd06c3e972) Co-authored-by: Oren Milman <orenmn@gmail.com>
* bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9149)Miss Islington (bot)2018-09-111-0/+30
| | | | | | | | | | | | | | | | | When subprocess.Popen() stdin= stdout= or stderr= handles are specified and appear in pass_fds=, don't close the original fds after dup'ing them. This implementation and unittest primarily came from @izbyshev (see the PR) See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c This also removes the old manual p2cread, c2pwrite, and errwrite closing logic as inheritable flags and _close_open_fds takes care of that properly today without special treatment. This code is within child_exec() where it is the only thread so there is no race condition between the dup and _Py_set_inheritable_async_safe call. (cherry picked from commit ce34410b8b67f49d8275c05d51b3ead50cf97f48) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
* bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)Miss Islington (bot)2018-09-101-2/+59
| | | | | | | | | | | The recursive frame pruning code always undercounted the number of elided frames by one. That is, in the "[Previous line repeated N more times]" message, N would always be one too few. Near the recursive pruning cutoff, one frame could be silently dropped. That situation is demonstrated in the OP of the bug report. The fix is to start the identical frame counter at 1. (cherry picked from commit d545869d084e70d4838310e79b52a25a72a1ca56) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* Test dict values iterator pickling with pickle.HIGHEST_PROTOCOL. (GH-9052)Miss Islington (bot)2018-09-101-1/+1
| | | | | (cherry picked from commit 1f36bf6077d93cb43fd84bea4a8a625fa772d1fa) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* [3.6] bpo-34246: Use no mutable default args in smtplib (GH-8554) (#9112)Pablo Galindo2018-09-081-0/+32
| | | | | | | | Some methods of the SMTP class use mutable default arguments. Specially `send_message` is affected as it mutates one of the args by appending items to it, which has side effects on further calls.. (cherry picked from commit d5fbe9b1a3d65ceeb9159c5ba999ee966a945f76) Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
* [3.6] bpo-34007: Skip traceback tests if the Program Counter is not ↵Pablo Galindo2018-09-071-0/+9
| | | | | | | | | | | | available. (GH-9022) Sometimes some versions of the shared libraries that are part of the traceback are compiled in optimised mode and the Program Counter (PC) is not present, not allowing gdb to walk the frames back. When this happens, the Python bindings of gdb raise an exception, making the test impossible to succeed. (cherry picked from commit f2ef51f8bec525b21e52988880c8a029642795ed) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.6] bpo-34594: Don't hardcode errno values in the tests. (GH-9096)Zackery Spytz2018-09-071-2/+0
| | | (cherry picked from commit b03c2c51909e3b5b5966d86a2829b5ddf2d496aa)
* [3.7] bpo-26544: Get rid of dependence from distutils in platform. (GH-8356) ↵Miss Islington (bot)2018-09-051-0/+36
| | | | | | | | (GH-8970) (GH-9061) (cherry picked from commit 7d81e8f5995df6980a1a02923e224a481375f130) (cherry picked from commit 20a8392cec2967f15ae81633c1775645b3ca40da) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-13312: Avoid int underflow in time year. (GH-8912)Miss Islington (bot)2018-08-251-6/+5
| | | | | | Avoids an integer underflow in the time module's year handling code. (cherry picked from commit 76be0fffff8b7dbe649ad4821144461800ffb0d0) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks ↵Miss Islington (bot)2018-08-242-2/+18
| | | | | | | (GH-8864) (cherry picked from commit 91cb298f811961277fd4cc4a32211899d48bedcb) Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
* [3.6] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (#8790)Miss Islington (bot)2018-08-161-0/+5
| | | | | | | | | | | | | | | Read from data socket to avoid "[SSL] shutdown while in init" exception during shutdown of the dummy server. Signed-off-by: Christian Heimes <christian@python.org> <!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) --> https://bugs.python.org/issue34391 <!-- /issue-number --> (cherry picked from commit 1590c393360df059160145e7475754427bfc6680) Co-authored-by: Christian Heimes <christian@python.org>
* [3.6] bpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8764)Christian Heimes2018-08-1520-459/+759
| | | | | | | | | | | | | Downstream vendors have started to deprecate weak keys. Update all RSA keys and DH params to use at least 2048 bits. Finite field DH param file use RFC 7919 values, generated with certtool --get-dh-params --sec-param=high Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 88bfd0bce05043f658e50addd21366f317995e35) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976) (GH-8760)Christian Heimes2018-08-151-19/+30
| | | | | | | | | Change TLS 1.3 cipher suite settings for compatibility with OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by default. Also update multissltests to test with latest OpenSSL. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32947: Fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-8761)Christian Heimes2018-08-142-7/+27
| | | | | | | | | | | | | | Backport of TLS 1.3 related fixes from 3.7. Misc fixes and workarounds for compatibility with OpenSSL 1.1.1 from git master and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by default. Some test cases only apply to TLS 1.2. OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS 1.3. The feature is enabled by default for maximum compatibility with broken middle boxes. Users should be able to disable the hack and CPython's test suite needs it to verify default options Signed-off-by: Christian Heimes <christian@python.org>
* bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)Miss Islington (bot)2018-08-071-0/+14
| | | | | (cherry picked from commit e4dcbbd7f4ac18d01c0ec85f64ae98b8281ed403) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)Steve Dower2018-08-071-0/+4
|
* [3.6] bpo-34272: Move argument parsing tests from test_capi to ↵Serhiy Storchaka2018-08-062-291/+182
| | | | | | test_getargs2. (GH-8567). (GH-8690) (cherry picked from commit 8f7bb100d0fa7fb2714f3953b5b627878277c7c6)
* bpo-30317: Fix multiprocessing test_timeout() (GH-8621)Pablo Galindo2018-08-031-3/+4
| | | | | | | | Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d030e100aade54210034828b711c3b506b18) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.6] bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931) ↵Serhiy Storchaka2018-07-312-15/+62
| | | | | | | | | | | | | | (GH-8584) * Fix integer overflow in os.readv(), os.writev() and in os.sendfile() with headers or trailers arguments (on BSD-based OSes and MacOS). * Fix sending the part of the file in os.sendfile() on MacOS. Using the trailers argument could cause sending more bytes from the input file than was specified. Thanks Ned Deily for testing on 32-bit MacOS. (cherry picked from commit 9d5727326af53ddd91016d98e16ae7cf829caa95)
* bpo-33476: Fix _header_value_parser when address group is missing final ';' ↵Miss Islington (bot)2018-07-281-0/+25
| | | | | | | (GH-7484) (cherry picked from commit 8fe9eed937cb69b5e26ac6e36a90b5360eb11277) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* [3.6] bpo-29097: Forego fold detection on windows for low timestamp values ↵Ammar Askar2018-07-271-1/+5
| | | | | | | | (GH-2385) (GH-8498) On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.. (cherry picked from commit 96d1e69a12ed8ab80203277e1abdaf573457a964) Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
* bpo-32663 Make SMTPUTF8SimTests run (GH-5314) (#8470)Miss Islington (bot)2018-07-261-25/+14
| | | | | | | | | | | | | | Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in). (cherry picked from commit 48ed88a93bb0bbeaae9a4cfaa533e4edf13bcb51) Co-authored-by: chason <chason@gmail.com>
* [3.6] bpo-34164: Fix handling of incorrect padding in base64.b32decode(). ↵Serhiy Storchaka2018-07-241-5/+14
| | | | | | | | | (GH-8351) (GH-8436) Now base64.Error is always raised instead of UnboundLocalError or OverflowError. (cherry picked from commit ac0b3c2f4d86fc056b833a4e6b9a380741244a63) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-34136: Make test_do_not_recreate_annotations more reliable. ↵Miss Islington (bot)2018-07-241-5/+8
| | | | | | | | (GH-8364) (GH-8366) (cherry picked from commit 06ca3f0c09d017b9d741553818459cca2d5da587) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Miss Islington (bot)2018-07-231-6/+17
| | | | | | | (GH-8262) (GH-8424) (cherry picked from commit aba24ff3601ddc86b85e01880a8be596fb799287) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)Miss Islington (bot)2018-07-231-4/+14
| | | | | | | | | | | | | When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test. (cherry picked from commit 752d4b7531093c55d6f0a5846748f981d79b29d3) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34179: Make sure decimal context doesn't affect other tests. (GH-8376) ↵Miss Islington (bot)2018-07-211-13/+13
| | | | | | | (#8384) (cherry picked from commit 938045f335b52ddb47076e9fbe4229a33b4bd9be) Co-authored-by: Bo Bayles <bbayles@gmail.com>
* bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)Miss Islington (bot)2018-07-191-2/+3
| | | | | | | | Increase the timeout: give timeout x 4 instead of timeout x 2 to threads to wait until the Event is set, but reduce the sleep from 500 ms to 250 ms. So the test should be more reliable and faster! (cherry picked from commit 81950495ba2c36056e0ce48fd37d514816c26747) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34130: Fix test_signal.test_socket() (GH-8326) (GH-8330)Miss Islington (bot)2018-07-181-1/+0
| | | | | | | | | | | test_signal.test_socket(): On Windows, sometimes even if the C signal handler succeed to write the signal number into the write end of the socketpair, the test fails with a BlockingIOError on the non-blocking read.recv(1) because the read end of the socketpair didn't receive the byte yet. Fix the race condition on Windows by setting the read end as blocking. (cherry picked from commit 99bb6df66a42625367c4f38e6802c8bb527baf4a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an ↵Serhiy Storchaka2018-07-171-0/+10
| | | | | | | exception set (GH-8282). (GH-8312) (cherry picked from commit 28f07364f066792ceee93231dbb80ae8ad98b2bb) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-33967: Fix wrong use of assertRaises (GH-8306)Miss Islington (bot)2018-07-171-1/+1
| | | | | (cherry picked from commit 56d8f57b83a37b05a6f2fbc3e141bbc1ba6cb3a2) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-33967: Remove use of deprecated assertRaisesRegexp() (GH-8261) (GH-8295)Miss Islington (bot)2018-07-161-1/+1
| | | | | | It was added in test_functools at 445f1b3. (cherry picked from commit 9e9b2c32a34594e901b5b9a03c561a2a2bf63ece) Co-authored-by: Zackery Spytz <zspytz@gmail.com>