summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32663 Make SMTPUTF8SimTests run (#5314)chason2018-07-251-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).
* bpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)Victor Stinner2018-07-251-2/+10
| | | | | PYTHONTRACEMALLOC=0 environment variable and -X tracemalloc=0 command line option are now allowed to disable explicitly tracemalloc at startup.
* bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)Ammar Askar2018-07-251-1/+6
| | | 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.
* bpo-13041: Use shutil.get_terminal_size() in argparse.HelpFormatter (GH-8459)Berker Peksag2018-07-251-2/+3
|
* bpo-34195: Fix case-sensitive comparison in test_nt_helpers (GH-8448)Tim Golden2018-07-251-5/+11
| | | | | * Fix case-sensitive comparison test_nt_helpers assumed that two versions of a Windows path could be compared case-sensitively. This is not the case, and the difference can be triggered (apparently) by running the test on a path somewhere below a Junction.
* bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)Victor Stinner2018-07-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more fields to _PyCoreConfig: * _check_hash_pycs_mode * bytes_warning * debug * inspect * interactive * legacy_windows_fs_encoding * legacy_windows_stdio * optimization_level * quiet * unbuffered_stdio * user_site_directory * verbose * write_bytecode Changes: * Remove pymain_get_global_config() and pymain_set_global_config() which became useless. These functions have been replaced by _PyCoreConfig_GetGlobalConfig() and _PyCoreConfig_SetGlobalConfig(). * sys.flags.dont_write_bytecode value is now restricted to 1 even if -B option is specified multiple times on the command line. * PyThreadState_Clear() now uses the config from the current interpreter rather than using global Py_VerboseFlag
* bpo-34136: Make test_do_not_recreate_annotations more lenient. (GH-8437)Serhiy Storchaka2018-07-241-5/+4
|
* bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351)Serhiy Storchaka2018-07-241-5/+14
| | | | | Now base64.Error is always raised instead of UnboundLocalError or OverflowError.
* bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)Serhiy Storchaka2018-07-241-23/+8
| | | | | Also make getchildren() and getiterator() emitting a DeprecationWarning instead of PendingDeprecationWarning.
* bpo-34149: Behavior of the min/max with key=None (GH-8328)Alexander Marshalov2018-07-241-0/+4
| | | Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().
* bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Serhiy Storchaka2018-07-231-6/+17
| | | | (GH-8262)
* bpo-34183: Fix running Lib/test/test_contextlib_async.py as a script. (GH-8381)Serhiy Storchaka2018-07-231-1/+1
|
* bpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382)Serhiy Storchaka2018-07-231-5/+5
|
* bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)Victor Stinner2018-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.
* bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)Xtreak2018-07-221-0/+16
|
* bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380)Serhiy Storchaka2018-07-211-2/+2
|
* bpo-34179: Make sure decimal context doesn't affect other tests. (#8376)Bo Bayles2018-07-211-13/+13
|
* bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)jdemeyer2018-07-211-0/+16
|
* bpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364)Serhiy Storchaka2018-07-211-5/+9
|
* bpo-33723: Fix test_time.test_process_time() (GH-8358)Victor Stinner2018-07-211-4/+9
| | | | | | The test failed on my laptop because the busy loop took 15.9 ms whereas the test expects at least 20 ms. Modify test_process_time() as test_thread_time() has been modified recently: only require 15 ms instead of 20 ms.
* bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)Victor Stinner2018-07-201-0/+8
| | | | | Py_Main() can again be called after Py_Initialize(), as in Python 3.6. The new configuration is ignored, except of _PyMainInterpreterConfig.argv which is used to update sys.argv.
* bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)Victor Stinner2018-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!
* bpo-34130: Fix test_signal.test_warn_on_full_buffer() (GH-8327)Victor Stinner2018-07-181-15/+41
| | | | | | | | | | | | | | | | | On Windows, sometimes test_signal.test_warn_on_full_buffer() fails to fill the socketpair buffer. In that case, the C signal handler succeed to write into the socket, it doesn't log the expected send error, and so the test fail. On Windows, the test now uses a timeout of 50 ms to fill the socketpair buffer to fix this race condition. Other changes: * Begin with large chunk size to fill the buffer to speed up the test. * Add error messages to assertion errors to more easily identify which assertion failed. * Don't set the read end of the socketpair as non-blocking.
* bpo-34130: Fix test_signal.test_socket() (GH-8326)Victor Stinner2018-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.
* bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an ↵Zackery Spytz2018-07-171-0/+10
| | | | exception set (GH-8282)
* bpo-33967: Fix wrong use of assertRaises (GH-8306)INADA Naoki2018-07-171-1/+1
|
* bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)INADA Naoki2018-07-143-0/+10
| | | | | | `_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char. It caused buffer overflow in `_Py_string_to_number_with_underscores()`. This bug is introduced in 9b6c60cb.
* bpo-33723: Fix test_time.test_thread_time() (GH-8267)Victor Stinner2018-07-121-4/+9
| | | | | | The test failed on AMD64 Debian root 3.x buildbot because the busy loop of 100 ms only increased time.thread_time() by 19.9 ms which is smaller than 20 ms. Modify the test to tolerate a delta of at least 15 ms instead of 20 ms.
* bpo-33967: Remove use of deprecated assertRaisesRegexp() (GH-8261)Zackery Spytz2018-07-121-1/+1
| | | It was added in test_functools at 445f1b3.
* bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)Serhiy Storchaka2018-07-111-0/+32
|
* bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245)Victor Stinner2018-07-111-2/+3
| | | | | Change test_logging.SMTPHandlerTest timeout from 8 seconds to 1 minute. The test failed randomly on the slow x86 Gentoo Refleaks 3.7 buildbot.
* Simplify __all__ in multiprocessing (GH-6856)Derek B. Kim2018-07-111-0/+6
|
* bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)Bradley Laney2018-07-102-3/+2
| | | Contributed by Bradley Laney.
* bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)Dong-hee Na2018-07-101-0/+7
|
* Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191)Sergey Fedoseev2018-07-095-8/+12
| | | Fixed also testing the "always" warning filter.
* bpo-33305: Improve SyntaxError for invalid numerical literals. (GH-6517)Serhiy Storchaka2018-07-091-0/+24
|
* bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684)Serhiy Storchaka2018-07-091-1/+7
|
* bpo-31014: Fix the webbrowser module. (GH-7267)Serhiy Storchaka2018-07-081-0/+19
| | | | | | | webbrowser._synthesize() called webbrowser.register() with outdated signature. Co-Authored-By: John Still <john@jmsdvl.com>
* closes bpo-34056: Always return bytes from _HackedGetData.get_data(). (GH-8130)Benjamin Peterson2018-07-071-0/+15
| | | | | | | | | | * Always return bytes from _HackedGetData.get_data(). Ensure the imp.load_source shim always returns bytes by reopening the file in binary mode if needed. Hash-based pycs have to receive the source code in bytes. It's tempting to change imp.get_suffixes() to always return 'rb' as a mode, but that breaks some stdlib tests and likely 3rdparty code, too.
* bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior ↵Ammar Askar2018-07-061-24/+47
| | | | | | | | | (GH-7891) 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.
* bpo-34044: subprocess.Popen copies startupinfo (GH-8090)Victor Stinner2018-07-051-0/+27
| | | | | | | subprocess.Popen now copies the startupinfo argument to leave it unchanged: it will modify the copy, so that the same STARTUPINFO object can be used multiple times. Add subprocess.STARTUPINFO.copy() method.
* Fix fuzz testing for marshal.loads(). (GH-8106)Serhiy Storchaka2018-07-051-4/+5
|
* bpo-33720: Improve tests for the stack overflow in marshal.loads(). (GH-7336)Serhiy Storchaka2018-07-051-6/+17
|
* bpo-32942: Fix environment dependent test_script_helper (GH-8034)Lorenz Mende2018-07-041-16/+31
| | | | Result of function interpreter_requires_environment() depends on os.environ. This was not covered by the tests, leading to fail when PYTHONHOME was set.
* bpo-34040, multiprocessing: Fix test_forkserver_sigkill() (GH-8081)Victor Stinner2018-07-041-2/+6
| | | | | | | | Fix test_forkserver_sigkill() of test_multiprocessing_forkserver: give more time to the first child process to complete, double the sleep in the parent process. Reduce also the child process sleep from 1000 ms to 500 ms, to not change the total duration of the test.
* bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918)Zackery Spytz2018-07-031-1/+16
| | | | PyErr_Print() will not return when the exception is a SystemExit, so decref the __main__ module object in that case.
* bpo-34019: Fix wrong arguments for Opera Browser (#8047)Bumsik Kim2018-07-031-8/+8
| | | | | The Opera Browser was using a outdated command line invocation that resulted in an incorrect URL being opened in the browser when requested using the webbrowser module. * Correct the arguments passed to the Opera Browser when opening a new URL.
* bpo-33735: Fix test_multiprocessing random failure (GH-8059)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()
* bpo-33978: Close existing handlers before logging (re-)configuration. (GH-8008)Xtreak2018-07-021-0/+75
|
* bpo-32568: make select.epoll() and its docs consistent (#7840)Tal Einat2018-06-301-9/+16
| | | | | | | | | | | | | * `flags` is indeed deprecated, but there is a validation on its value for backwards compatibility reasons. This adds mention of this in the docs. * The docs say that `sizehint` is deprecated and ignored, but it is still used when `epoll_create1()` is unavailable. This adds mention of this in the docs. * `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`. This is needed to have a default value available at the Python level, since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938) * Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`. The relevant tests have also been updated.