summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31249: Fix ref cycle in ThreadPoolExecutor (#3253)Victor Stinner2017-09-011-12/+20
| | | [3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor
* [3.6] bpo-31291: Fixed an assertion failure in ↵Oren Milman2017-08-301-0/+17
| | | | | | zipimport.zipimporter.get_data() (GH-3226) (#3243) if pathname.replace('/', '\\') returns non-string. (cherry picked from commit 631fdee6e61b4ba8ce800f827fecdd536bfb04f3)
* [3.6] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3233)Oren Milman2017-08-291-0/+20
| | | (cherry picked from commit ba7d7365215d791025d1efd25393c91404f2cfc8)
* [3.6] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. ↵Oren Milman2017-08-261-0/+8
| | | | | (GH-3201) (#3209) (cherry picked from commit a5b4ea15b61e3f3985f4f0748a18f8b888a63532)
* [3.6] bpo-28261: Prevent raising SystemError where PyArg_ParseTuple is used ↵Oren Milman2017-08-262-0/+5
| | | | to parse non-args. (#3210)
* bpo-31161: only check for parens error for SyntaxError (#3083)Martijn Pieters2017-08-221-0/+28
| | | | | Subclasses such as IndentError and TabError should not have this message applied.
* bpo-31259: test_urllib2_localnet uses addCleanup(server.stop) (#3186)Victor Stinner2017-08-221-5/+14
| | | | | | Use self.addCleanup(self.server.stop) to stop the HTTP server. Some tests didn't stop the server like test_https(). Fix also the usage of support.threading_cleanup().
* bpo-31234: fork_wait tests now join threads (#3139) (#3187)Victor Stinner2017-08-221-8/+17
| | | | | | fork_wait.py tests now joins threads, to not leak running threads in the background. (cherry picked from commit c99d41f9c0304fcf06550515c3db55f93a629e9e)
* [3.6] bpo-30871: Add test.pythoninfo (#3174)Victor Stinner2017-08-212-3/+471
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-30871: Add test.pythoninfo (#3075) * Add Lib/test/pythoninfo.py: script collecting various informations about Python to help debugging test failures. * regrtest: remove sys.hash_info and sys.flags from header. * Travis CI, Appveyor: run pythoninfo before tests (cherry picked from commit b907abc88589f7bea52c5afe172ececc6edcda70) * bpo-30871: pythoninfo: add expat and _decimal (#3121) * bpo-30871: pythoninfo: add expat and _decimal * Remove _decimal.__version__ The string is hardcoded, not really interesting. (cherry picked from commit f6ebd838f00b4c211c72d85ee49749e910cd3afe) * bpo-30871: Add "make pythoninfo" (#3120) (cherry picked from commit a3a01a2fceab2188b282ab9911f79c99a4c32273) * bpo-30871: pythoninfo: more sys, os, time data (#3130) * bpo-30871: pythoninfo: more sys, os, time data PythonInfo now converts types other than intger to string by default. * fix typo (cherry picked from commit ad7eaed54382b346784e51a6f0122ce81e8842b5) * bpo-31231: Fix pythoninfo in Travis config (#3134) bpo-31231, bpo-30871: Replace "./python -m test.pythoninfo" with "make pythoninfo", since macOS uses ./python.exe. (cherry picked from commit 92b1f90143286385c0ff5be98d3721b90580a912)
* [3.6] bpo-30121: Fix debug assert in subprocess on Windows (#1224) (#3173)Victor Stinner2017-08-211-8/+52
| | | | | | | | | | | | | | | | | | | * bpo-30121: Fix debug assert in subprocess on Windows (#1224) * bpo-30121: Fix debug assert in subprocess on Windows This is caused by closing HANDLEs using os.close which is for CRT file descriptors and not for HANDLEs. * bpo-30121: Suppress debug assertion in test_subprocess when ran directly (cherry picked from commit 4d3851727fb82195e4995c6064b0b2d6cbc031c4) * Add test_subprocess.test_nonexisting_with_pipes() (#3133) bpo-30121: Test the Popen failure when Popen was created with pipes. Create also NONEXISTING_CMD variable in test_subprocess.py. (cherry picked from commit 9a83f651f31b47b3f6c8b210f7807b26e8c373a5)
* [3.6] bpo-31232: Backport custom print rshift message (GH-3155)Nick Coghlan2017-08-191-0/+33
| | | | | | | | | | | | | bpo-30721 added a "Did you mean ...?" suggestion to rshift TypeError messages that triggers when the LHS is a Python C function called "print". Since this custom error message is expected to be triggered primarily by attempts to use Python 2 print redirection syntax in Python 3, and is incredibly unlikely to be encountered otherwise, it is also being backported to the next 3.6 maintenance release. Initial patch by Sanyam Khurana.
* bpo-31234: test_threading: fix ref cycle (#3150) (#3152)Victor Stinner2017-08-191-0/+2
| | | | | test_bare_raise_in_brand_new_thread() now explicitly breaks a reference cycle to not leak a dangling thread. (cherry picked from commit 3d284c081fc3042036adfe1bf2ce92c34d743b0b)
* bpo-31235: Fix ResourceWarning in test_logging (#3147) (#3149)Victor Stinner2017-08-181-0/+1
| | | (cherry picked from commit a7719e27b3cad0f2b86cb932a76cbe55c541b02e)
* bpo-31069, test_multiprocessing: Fix dangling process (#3103) (#3104)Victor Stinner2017-08-161-1/+2
| | | | | Fix a warning about dangling processes in test_rapid_restart() of _test_multiprocessing: join the process. (cherry picked from commit 17657bb9458ff8f8804b7637d61686a68f4b9471)
* [3.6] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3093)Christian Heimes2017-08-151-2/+3
| | | | | | | | | | | OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that. The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN callback can pretend to not been set. See https://github.com/openssl/openssl/pull/3158 for more details Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit a5c1bab352671e043645163ca50c5211aa657acd)
* bpo-31067: test_subprocess calls reap_children() (#2931) (#3074)Victor Stinner2017-08-111-0/+2
| | | | | test_subprocess now also calls reap_children() in tearDown(), not only on setUp(). (cherry picked from commit cc42c121eb5346f673247f95dac575aadb77d66c)
* bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3070)Victor Stinner2017-08-111-35/+22
| | | | | | | | | | | | | | The current test_child_terminated_in_stopped_state() function test creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and then crash (SIGSEGV). The problem is that calling os.waitpid() in the parent process is not enough to close the process: the child process remains alive and so the unit test leaks a child process in a strange state. Closing the child process requires non-trivial code, maybe platform specific. Remove the functional test and replaces it with an unit test which mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to test the WIFSTOPPED() path. (cherry picked from commit 7b7c6dcfff6a35333988a3c74c895ed19dff2e09)
* bpo-31008: Fix asyncio test_wait_for_handle on Windows (#3065) (#3068)Victor Stinner2017-08-101-1/+3
| | | (cherry picked from commit 5659a72f487579be76335c09c8ba8b2f1800adde)
* [3.6] bpo-31160: Backport reap_children() fixes from master to 3.6 (#3060)Victor Stinner2017-08-103-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | * bpo-31160: Fix test_builtin for zombie process (#3043) PtyTests.run_child() now calls os.waitpid() to read the exit status of the child process to avoid creating zombie process and leaking processes in the background. (cherry picked from commit 4baca1b0f7325032598cd38e7ceffc79b616d255) * bpo-31160: regrtest now reaps child processes (#3044) Add a post_test_cleanup() function which currently only calls support.reap_children(). (cherry picked from commit e3510d74aacc477c30f42f2b941d69689bbc478e) * bpo-31160: test_builtin: don't check waitpid() status (#3050) (cherry picked from commit 3ca9f50f96cfa5c1b7aa56639042531b57f07fbb) * bpo-31160: test_tempfile: Fix reap_children() warning (#3056) TestRandomNameSequence.test_process_awareness() now calls os.waitpid() to avoid leaking a zombie process. (cherry picked from commit 6c8c2943d996b59a48d331f61f22cbe72933910e)
* [3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread ↵Ammar Askar2017-08-091-0/+2
| | | | reaped warnings (#3041)
* bpo-31029: test_tokenize Add missing import unittest (#2998)Rajath Agasthya2017-08-051-0/+1
|
* [3.6] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989) (#3003)Shane Harvey2017-08-051-0/+10
| | | (cherry picked from commit c4c9866064f03646c686d7e08b00aeb203c35c19)
* [3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking ↵Serhiy Storchaka2017-08-031-0/+16
| | | | | | (GH-2957) (#2991) when other arguments are passed. (cherry picked from commit 25e4f77)
* [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. ↵Serhiy Storchaka2017-08-032-1/+8
| | | | | | (GH-2790) (#2992) Previously any exception was replaced with a KeyError exception. (cherry picked from commit 5075416)
* bpo-31061: fix crash in asyncio speedup module (GH-2984)INADA Naoki2017-08-022-0/+27
| | | (cherry picked from commit de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2)
* [3.6] bpo-31027: Fix test_listcomps failure when run directly (GH-2939) (#2945)Terry Jan Reedy2017-07-291-1/+1
| | | | Bug appears to be incomplete copy-paste-edit. (cherry picked from commit ceb93f4)
* bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2917)Victor Stinner2017-07-271-0/+4
| | | | | | There is a bug in FreeBSD CURRENT with 64-bit dev_t. Skip the test if dev_t is larger than 32-bit, until the bug is fixed in FreeBSD CURRENT. (cherry picked from commit 12953ffe12ac781332b384c36b25d12216b1db62)
* bpo-31028: Fix test_pydoc when run directly (#2864) (#2910)Victor Stinner2017-07-271-1/+1
| | | | | | | | | | | * bpo-31028: Fix test_pydoc when run directly Fix get_pydoc_link() of test_pydoc to fix "./python Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent relative directories. * Use realpath() instead of abspath() (cherry picked from commit fd46561167af6cd697191dd7ebb8c2fef5ad6493)
* bpo-30980: Fix double close in asyncore.file_wrapper (#2789) (#2898)Nir Soffer2017-07-261-1/+4
| | | | | | | | | | | | | | * bpo-30980: Fix close test to fail test_close_twice was not considering the fact that file_wrapper is duping the file descriptor. Closing the original descriptor left the duped one open, hiding the fact that close protection is not effective. * bpo-30980: Fix double close protection Invalidated self.fd before closing, handling correctly the case when os.close raises. * bpo-30980: Fix fd leak introduced in the fixed test
* [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal ↵Dong-hee Na2017-07-261-1/+5
| | | | command (#1214) (#2886)
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) (#2816)Utkarsh Upadhyay2017-07-262-8/+12
| | | | | | | | | | | | * [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) Only C implementation was tested. (cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75) * [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) Only C implementation was tested.. (cherry picked from commit 287c5594edc1ca08db64d1f4739cc36bfe75ae75)
* bpo-30845: Enhance test_concurrent_futures cleanup (#2564) (#2880)Victor Stinner2017-07-262-1/+9
| | | | | | | | | | | | * bpo-30845: reap_children() now logs warnings * bpo-30845: Enhance test_concurrent_futures cleanup In setUp() and tearDown() methods of test_concurrent_futures tests, make sure that tests don't leak threads nor processes. Clear explicitly the reference to the executor to make it that it's destroyed (to prevent "dangling threads" warning). (cherry picked from commit 3df9dec425b0254df1cdf41922fd8d6b08bf47e4)
* [3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to ↵Victor Stinner2017-07-261-22/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3.6 (#2879) * bpo-26762: Avoid daemon process in _test_multiprocessing (#2842) test_level() of _test_multiprocessing._TestLogging now uses regular processes rather than daemon processes to prevent zombi processes (to not "leak" processes). (cherry picked from commit 06634950c553f8df83330ed468c11483b857b7dc) * test_multiprocessing: Fix dangling process/thread (#2850) bpo-26762: Fix more dangling processes and threads in test_multiprocessing: * Queue: call close() followed by join_thread() * Process: call join() or self.addCleanup(p.join) (cherry picked from commit d7e64d9934d86aa6173229de5af5fe908662a33a) * test_multiprocessing detects dangling per test case (#2841) bpo-26762: test_multiprocessing now detects dangling processes and threads per test case classes: * setUpClass()/tearDownClass() of mixin classes now check if multiprocessing.process._dangling or threading._dangling was modified to detect "dangling" processses and threads. * ManagerMixin.tearDownClass() now also emits a warning if it still has more than one active child process after 5 seconds. * tearDownModule() now checks for dangling processes and threads before sleep 500 ms. And it now only sleeps if there is a least one dangling process or thread. (cherry picked from commit ffb49408f0780ae80a553208aa133bc5bb3ba129) * bpo-26762: test_multiprocessing close more queues (#2855) * Close explicitly queues to make sure that we don't leave dangling threads * test_queue_in_process(): remove unused queue * test_access() joins also the process to fix a random warning (cherry picked from commit b4c52966c810b5c5e088fceff403247f610b7d13) * bpo-31019: Fix multiprocessing.Process.is_alive() (#2875) multiprocessing.Process.is_alive() now removes the process from the _children set if the process completed. The change prevents leaking "dangling" processes. (cherry picked from commit 2db64823c20538a6cfc6033661fab5711d2d4585)
* bpo-31034: Reliable signal handler for test_asyncio (#2867) (#2876)Victor Stinner2017-07-262-31/+45
| | | | | | | | | | * bpo-31034: Reliable signal handler for test_asyncio Don't rely on the current SIGHUP signal handler, make sure that it's set to the "default" signal handler: SIG_DFL. * Add comments (cherry picked from commit 830080913c22a9834d310294b9f7653234dc6a59)
* bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2844)Victor Stinner2017-07-241-0/+1
| | | | | | | | | | | | | | tearDown() now clears explicitly the self.server variable to make sure that the thread is completely cleared when tearDownClass() checks if all threads have been cleaned up. Fix the following warning: $ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os (...) Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2) (...) Tests result: ENV CHANGED (cherry picked from commit d1cc037d1442cc35d1b194ec8e50901514360949)
* [3.6] Make test_shutil test_disk_usage not depend on the cwd fs (GH-2597) ↵Gregory P. Smith2017-07-231-1/+1
| | | | | | (#2820) Make test_shutil test_disk_usage not depend on the current working directory's filesystem. (cherry picked from commit 529746c90584069270cd122920270bd7be38bca3)
* bpo-30822: Exclude tzdata from regrtest --all (#2775) (#2777)Victor Stinner2017-07-203-5/+25
| | | | | | | | | | | | | | When running the test suite using --use=all / -u all, exclude tzdata since it makes test_datetime too slow (15-20 min on some buildbots) which then times out on some buildbots. -u tzdata must now be enabled explicitly, -u tzdata or -u all,tzdata, to run all test_datetime tests. Fix also regrtest command line parser to allow passing -u extralargefile to run test_zipfile64. Travis CI: remove -tzdata. Replace -u all,-tzdata,-cpu with -u all,-cpu since tzdata is now excluded from -u all. (cherry picked from commit 5b392bbaeb9d9b1db961ecfc7315d8c8662c27f6)
* [3.6] bpo-30883: Use pythontest.net instead of debian.org in test_urllib2net ↵Ammar Askar2017-07-201-3/+3
| | | | (GH-2755)
* [3.6] bpo-30936: Fix a reference leak in json when fail to sort keys. ↵Serhiy Storchaka2017-07-161-0/+4
| | | | | (GH-2712). (#2727) (cherry picked from commit 49f6449ef4b81537c19b82329caaf60596c516c2)
* [3.6] bpo-30876: Relative import from unloaded package now reimports the ↵Serhiy Storchaka2017-07-164-4/+22
| | | | | | | | | package (GH-2639) (#2676) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError. (cherry picked from commit 8a9cd20edca7d01b68292036029ae3735ce65edd)
* [3.6] bpo-30911: Add tests for bad boolean arguments for accelerated json ↵Serhiy Storchaka2017-07-131-0/+22
| | | | | | (GH-2690) (#2692) encoder and decoder. (cherry picked from commit d3aaa2f)
* [3.6] bpo-30899: Add unittests, 100% coverage, for IDLE's two ConfigParser ↵terryjreedy2017-07-121-0/+1
| | | | | | subclasses. (GH-2662) (#2685) Patch by Louie Lu. (cherry picked from commit 50c9435)
* [3.6] bpo-30879: os.listdir() and os.scandir() now emit bytes names when ↵Serhiy Storchaka2017-07-112-3/+27
| | | | | | (GH-2634) (#2656) called with bytes-like argument.. (cherry picked from commit 1180e5a51871fa53ca6892e83fd2e69dc2600447)
* [3.6] bpo-29854: Fix segfault in call_readline() (GH-728)Nir Soffer2017-07-081-3/+47
| | | | | | | | | | | | | If history-length is set in .inputrc, and the history file is double the history size (or more), history_get(N) returns NULL, and python segfaults. Fix that by checking for NULL return value. It seems that the root cause is incorrect handling of bigger history in readline, but Python should not segfault even if readline returns unexpected value. This issue affects only GNU readline. When using libedit emulation system history size option does not work.
* bpo-30532: Fix whitespace folding in certain cases (#2591)Joel Hillacre2017-07-061-0/+12
| | | Leading whitespace was incorrectly dropped during folding of certain lines in the _header_value_parser's folding algorithm. This makes the whitespace handling code consistent.
* [3.6] bpo-30814: Fixed a race condition when import a submodule from a ↵Serhiy Storchaka2017-07-063-0/+30
| | | | | package. (GH-2580). (#2598) (cherry picked from commit b4baacee1adc06edbe30ac7574d17a8cd168e2e0)
* [3.6] bpo-30828: Fix out of bounds write in ↵Yury Selivanov2017-07-051-1/+23
| | | | | `asyncio.CFuture.remove_done_callback() (GH-2569) (#2590) (cherry picked from commit 833a3b0d3707200daeaccdd218e8f18a190284aa)
* [3.6] bpo-30441: Fix bug when modifying os.environ while iterating over it ↵Serhiy Storchaka2017-07-041-0/+24
| | | | | (GH-2409). (#2556) (cherry picked from commit 8a8d28501fc8ce25926d168f1c657656c809fd4c)
* bpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539)Victor Stinner2017-07-031-1/+3
| | | | --forever now stops if a fail changes the environment. (cherry picked from commit 5e87592fd12e0b7c41edc11d4885ed7298d5063b)
* [3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)Nick Coghlan2017-07-031-0/+28
| | | (cherry picked from commit 3a7f03584ab75afbf5507970711c87042e423bb4)