summaryrefslogtreecommitdiff
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] closes bpo-31608: Fix a crash in methods of a subclass of ↵backport-24bd50b-2.7Oren Milman2018-09-111-0/+15
| | | | | | | | _collections.deque with a bad __new__(). (GH-3788). (cherry picked from commit 24bd50bdcc97d65130c07d6cd26085fd06c3e972) Co-authored-by: Oren Milman <orenmn@gmail.com>
* bpo-34007: Skip traceback tests if the Program Counter is not available. ↵Miss Islington (bot)2018-08-311-0/+9
| | | | | | | | | | | | (GH-9018) 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>
* [2.7] bpo-6700: Fix inspect.getsourcelines for module level ↵Tal Einat2018-08-262-2/+19
| | | | | | | frames/tracebacks (GH-8864) (cherry picked from commit 91cb298f811961277fd4cc4a32211899d48bedcb) Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
* [2.7] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (GH-8791)Christian Heimes2018-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>
* [2.7] bpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8765)Christian Heimes2018-08-1415-373/+602
| | | | | | | | | | | | | 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>
* [2.7] bpo-34272: Move argument parsing tests from test_capi to ↵Serhiy Storchaka2018-08-062-140/+147
| | | | | | test_getargs2. (GH-8567). (GH-8691) (cherry picked from commit 8f7bb100d0fa7fb2714f3953b5b627878277c7c6)
* [2.7] bpo-34236: Remove mistakenly backported Test6012 in test_capi.py. ↵Zackery Spytz2018-08-061-6/+0
| | | | | (GH-8681) This was backported by mistake in ef19fd2.
* bpo-34229: Check start and stop of slice object to be long when they are not ↵Xtreak2018-07-261-1/+15
| | | | int in PySlice_GetIndices (GH-8480)
* [2.7] bpo-34068: iobase_close could call PyObject_SetAttrString with an ↵Serhiy Storchaka2018-07-171-0/+10
| | | | | | | | | exception set (GH-8282). (GH-8312) (GH-8314) (cherry picked from commit 28f07364f066792ceee93231dbb80ae8ad98b2bb) Co-authored-by: Zackery Spytz <zspytz@gmail.com>. (cherry picked from commit cc13016658a9ed86d0b702ab6c251ad5952a952f)
* [2.7] bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192). (GH-8255)Serhiy Storchaka2018-07-111-1/+130
| | | | | (cherry picked from commit 504373c59b48f1ea12132d515459022730db6047) Also backport tests for skipitem() and handling errors.
* [2.7] bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091) (#8225)Tal Einat2018-07-101-2/+1
| | | | | | | Actually just one fix on the 2.7 branch. Contributed by Bradley Laney. (cherry picked from commit 6b490b5db40fc29588e8e6cc23bb89c4fed74ad5)
* [2.7] Fixed several assertTrue() that were intended to be assertEqual(). ↵Serhiy Storchaka2018-07-093-6/+10
| | | | | | | | (GH-8191) (GH-8202) Fixed also testing the "always" warning filter. (cherry picked from commit b796e7dcdc24ff7ec53044af041254c83a8ace21) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684). (GH-8193) ↵Serhiy Storchaka2018-07-091-5/+11
| | | | | | | (GH-8196) (cherry picked from commit 2a9b8babf0d09946ebebfdb2931cc0d3db5a1d3d). (cherry picked from commit 7c43b801503c802ed6ea4b811f5bc73791249d94)
* [2.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line ↵Ammar Askar2018-07-061-12/+34
| | | | | | | | | | | behavior (GH-7891) (#8133) Most of the change involves fixing up the test suite, which previously made the assumption that there wouldn't be a new line if the input didn't end in one. Contributed by Ammar Askar. (cherry picked from commit c4ef4896eac86a6759901c8546e26de4695a1389)
* [2.7] bpo-33720: Improve tests for the stack overflow in marshal.loads(). ↵Serhiy Storchaka2018-07-051-2/+16
| | | | | | | (GH-7336). (GH-8107) (cherry picked from commit fc05e68d8fac70349b7ea17ec14e7e0cfa956121) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-33735: Fix test_multiprocessing random failure (GH-8059) (GH-8061)Victor Stinner2018-07-031-3/+3
| | | | | | | | | | | | | | When hunting memory leaks using -R 3:3, test_imap_unordered() of test_multiprocessing leaks randomly a few memory blocks. It is a false alarm: when testing using -R 3:20 for example, no leak is detected. Modify test_imap_unordered() to be closer to test_imap(): * Only test 10 numbers instead of 1000: it's a pool of 4 processes, so 10 is enough to test at least one number per process * Use chunksize=100 instead of chunksize=53 to mimick test_imap() (cherry picked from commit 23401fb960bb94e6ea62d2999527968d53d3fc65)
* [2.7] bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) ↵Serhiy Storchaka2018-06-301-0/+37
| | | | | | | | (GH-8021) Fix passing lists and tuples of strings containing special characters '"', '\\', '{', '}' and '\n' as options to tkinter.ttk widgets. (cherry picked from commit 5bb5bbfca847524bab5f2368bdb48eedf5dba74f)
* [2.7] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). ↵Zackery Spytz2018-06-291-0/+11
| | | | | | | (GH-3918). (GH-8013) (cherry picked from commit 23db935bcf258657682e66464bf8512def8af830) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-29514: Make magic number test work for candidates (GH-7946)Ned Deily2018-06-261-1/+1
|
* [2.7] bpo-33873: Backport regrtest from master (GH-7936)Victor Stinner2018-06-262-18/+69
| | | | | | | | | | | | | | | | | | | | | | | | * bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686) * Enhance also format_duration(): work on integers and rounds towards +infinity (math.ceil). * Write unit tests on format_duration() (cherry picked from commit 4ffe9c2b251f6e027b26250b7a2618e78d4edd22) * bpo-33873: regrtest: Add warning on -R 1:3 (GH-7736) regrtest: Add warning when using less than 3 warmup runs like -R 1:3. (cherry picked from commit cac4fef8860e66a9da67d09762f5b614b9471a12) * bpo-33873: Fix bug in `runtest.py` and add checks for invalid `-R` parameters (GH-7735) Fix bug in `Lib/test/libregrtest/runtest.py` that makes running tests an extra time than the specified number of runs. Add check for invalid --huntrleaks/-R parameters. (cherry picked from commit 58ed7307ea0b5c5aa052291ebc3030f314f938d8)
* bpo-33901: Fix test_gdbm for gdbm 1.15 (GH-7798) (GH-7818)Victor Stinner2018-06-201-3/+8
| | | | | | Fix test_gdbm.test_reorganize() on macOS with gdbm 1.15: add a larger value to make sure that the file size changes. (cherry picked from commit 13c79c677f9ec9437c82eda72fa1c2d288d8fceb)
* bpo-33717: set terse to True when calling platform.platform in ↵Miss Islington (bot)2018-06-201-1/+1
| | | | | | | test.pythoninfo (GH-7797) (GH-7803) (cherry picked from commit 71ca738f4cd2696d056d0cdb83bebd576f98ccc2) Co-authored-by: Xiang Zhang <angwerzx@126.com>
* bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7726)Victor Stinner2018-06-151-2/+20
| | | | | | | | | | | | | | | | | | | | * bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692) python-gdb now catchs ValueError on read_var(): when Python has no debug symbols for example. (cherry picked from commit 019d33b7a447e78057842332fb5d3bad01922122) * bpo-32962: python-gdb catchs UnicodeDecodeError (GH-7693) python-gdb now catchs UnicodeDecodeError exceptions when calling string(). (cherry picked from commit d22fc0bc7de7882da204abe50884bbde2da4f9e7) bpo-29367: python-gdb.py now supports also method-wrapper (wrapperobject) objects. (cherry picked from commit 611083331d534481ca7956a376e38fb0e9ef3854)
* bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 ↵Xiang Zhang2018-06-151-0/+13
| | | | | | | | | | (GH-1958) (GH-7704) Hangul composition check boundaries are wrong for the second character ([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3) instead of [0x11A7, 0x11C3]).. (cherry picked from commit d134809cd3764c6a634eab7bb8995e3e2eff14d5) Co-authored-by: Wonsup Yoon <pusnow@me.com>
* bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521) (GH-7562)Victor Stinner2018-06-092-7/+47
| | | | | | | | If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE then SUCCESS") to show that some failing tests have been re-run. Add also test_regrtest.test_rerun_fail() test. (cherry picked from commit c45fc7673e23f911639d10d3771ffef7be870c7a)
* bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)Miss Islington (bot)2018-06-081-9/+33
| | | | | | | | - bugfix and test for fragile metavar handling in argparse (see bpo-24089, bpo-14046, bpo-25058, bpo-11874) - also fixes some incorrect tests that did not make 1-element tuples correctly (cherry picked from commit 66f02aa32f1e4adb9f24cf186f8c495399d5ce9b) Co-authored-by: wim glenn <wim.glenn@gmail.com>
* [2.7] bpo-33751: Fix test_file. (GH-7378) (GH-7445)Serhiy Storchaka2018-06-081-87/+81
| | | | | | | | testModeStrings and testTruncateOnWindows were depended on a file leaked in other tests. Also improve cleaning up after tests. (cherry picked from commit c2745d2d05546d76f655ab450eb23d1af39e0b1c)
* bpo-31731: test_io hangs with --huntrleaks: exclude it (GH-7459)Victor Stinner2018-06-061-0/+6
| | | test_io hangs with --huntrleaks: exclude the test in regrtest.
* bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421) (GH-7456)Victor Stinner2018-06-062-8/+21
| | | | | | | | | | | Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d6424a7ca907c8ec1df21e51062e8f3d88e32)
* [2.7] bpo-33767: Fix improper use of SystemError by mmap.mmap objects ↵Serhiy Storchaka2018-06-051-0/+7
| | | | | | | | (GH-7381) (GH-7432) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e397605789b2a67b67558fbbe756b7b88934f5) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-18174: Fix fd_count() on FreeBSD (GH-7420)Victor Stinner2018-06-051-2/+3
| | | | Python 2.7 doesn't have FileNotFoundError exception: use OSError and errno.ENOENT.
* bpo-18174: regrtest -R 3:3 now also detects FD leak (#7409)Victor Stinner2018-06-053-20/+117
| | | | | | "python -m test --huntrleaks ..." now also checks for leak of file descriptors. Co-Authored-By: Richard Oudkerk <shibturn@gmail.com>
* bpo-18174: Fix file descriptor leaks in tests (GH-7408)Victor Stinner2018-06-052-0/+2
| | | | | | | | * test_tempfile.test_no_leak_fd() mocks os.close() but it doesn't call the original os.close() method and so leaks an open file descriptor. Fix the test by calling the original os.close() function. * test_posix.test_fdopen_directory(): close the directory file descriptor when the test completes.
* [2.7] bpo-31234: Join threads explicitly in tests (#7406)Victor Stinner2018-06-046-73/+122
| | | | | | | | | | | | | | | * Add support.wait_threads_exit(): context manager looping at exit until the number of threads decreases to its original number. * Add some missing thread.join() * test_asyncore.test_send(): call explicitly t.join() because the cleanup function is only called outside the test method, whereas the method has a @test_support.reap_threads decorator * test_hashlib: replace threading.Event with thread.join() * test_thread: * Use wait_threads_exit() context manager * Replace test_support with support * test_forkinthread(): check child process exit status in the main thread to better handle error.
* test_tools: catch stderr (GH-7404)Victor Stinner2018-06-041-2/+5
| | | Hide "recursedown('@test_9296_tmp')" message.
* [2.7] bpo-33718: Update regrtest from master (GH-7402)Victor Stinner2018-06-042-87/+144
| | | | | | | | | | | | | Backport manually regrtest enhancements from master: * No longer clear filters, like --match, to re-run failed tests in verbose mode (-w option). * Tests result: always indicate if tests have been interrupted. * Enhance tests summary * After failing tests are re-run, display again the summary. * Add environment_altered to test.support, but it's currently unused * regrtest: count also ENV_CHANGED as failures * regrtest: Enhance format_duration() * Replace test_support with support
* [2.7] bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362) (GH-7374)Serhiy Storchaka2018-06-031-7/+3
| | | | | | It depended on a global variable set by other tests.. (cherry picked from commit 7cfd8c6a1b53a7dbdea14b6f414f2629dcd130a2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [2.7] bpo-33760: Fix file leaks in test_io. (GH-7361). (GH-7373)Serhiy Storchaka2018-06-031-0/+3
| | | | | (cherry picked from commit e36837cb71032ccfa713e75623b314f091dc22bb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [2.7] bpo-33744: Fix test_uu. (GH-7350) (GH-7354)Serhiy Storchaka2018-06-031-82/+33
| | | | | Separate tests leaked files or were depended on files leaked in other tests. (cherry picked from commit 027f95c736457f12c5713d9cf5b95ac335e583df)
* bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7323)Victor Stinner2018-06-011-23/+25
| | | | | | Use also support.SOCK_MAX_SIZE, not only support.PIPE_MAX_SIZE, to get the size for a blocking send into a multiprocessing pipe. Replace also test_support with support.
* bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7314)Victor Stinner2018-06-017-24/+42
| | | | | | | | | | | | | | * bpo-31479: Always reset the signal alarm in tests Use "try: ... finally: signal.signal(0)" pattern to make sure that tests don't "leak" a pending fatal signal alarm. * Move two more alarm() calls into the try block Fix also typo: replace signal.signal(0) with signal.alarm(0) * Move another signal.alarm() into the try block (cherry picked from commit 9abee722d448c1c00c7d4e11ce242ec7b13e5c49)
* bpo-33692: Update pythoninfo from master (GH-7304)Victor Stinner2018-06-011-0/+29
| | | * bpo-33717: pythoninfo: add CC --version (GH-7290)
* Add a crasher to Lib/test for issue #26153. This crasher doesn't crash (#6518)T. Wouters2018-05-311-0/+29
| | | | Python 3.6, although I've seen the same crash in 3.6 (when involving extension types and more complicated threading setups).
* bpo-33532: Fix multiprocessing test_ignore() (GH-7265)Victor Stinner2018-05-311-2/+3
| | | | Fix test_multiprocessing.test_ignore(): use support.PIPE_MAX_SIZE to make sure that send_bytes() blocks.
* bpo-33645: Fix an "unknown parsing error" in the parser. (GH-7119)Serhiy Storchaka2018-05-311-1/+8
| | | | It is reproduced when parse the "<>" operator and run Python with both options -3 and -We.
* bpo-33692: pythoninfo detect libedit on Python 2.7 (#7246)Victor Stinner2018-05-301-0/+8
| | | | Check which readline implementation is used based on the readline docstring.
* bpo-29512: Rename Lib/test/bisect.py to bisect_cmd.py (#7229)Victor Stinner2018-05-301-0/+0
| | | | | | | | | Rename Lib/test/bisect.py to Lib/test/bisect_cmd.py. The old name was in conflict with Lib/bisect.py, causing test failures, depending how tests were run. For example, "python2.7 Lib/test/test_httpservers.py" imported indirectly Lib/test/bisect.py instead of Lib/bisect.py on "import bisect".
* test.regrtest: flush stdout to display progress (#7120)Victor Stinner2018-05-281-1/+2
| | | Call sys.stdout.flush() after displaying "running: ...".
* bpo-33354: Fix test_ssl when a filename cannot be encoded (GH-6613)Pablo Galindo2018-05-251-1/+8
| | | | Skip test_load_dh_params() of test_ssl when Python filesystem encoding cannot encode the provided path.
* [2.7] bpo-32861: robotparser fix incomplete __str__ methods. (GH-5711) ↵Serhiy Storchaka2018-05-151-0/+26
| | | | | | | | | (GH-6795) (GH-6817) The robotparser's __str__ representation now includes wildcard entries. (cherry picked from commit c3fa1f2b93fa4bf96a8aadc74ee196384cefa31e) Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>.