summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30215: Make re.compile() locale agnostic. (#1361)Serhiy Storchaka2017-05-051-0/+32
| | | | | | Compiled regular expression objects with the re.LOCALE flag no longer depend on the locale at compile time. Only the locale at matching time affects the result of matching.
* bpo-30263: regrtest: log system load (#1452)Victor Stinner2017-05-043-25/+39
| | | | | | | | * bpo-30263: regrtest: log system load * regrtest: log the number of CPUs Log the number of CPUs in the header. --verbose now imply --header.
* bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)Serhiy Storchaka2017-05-031-18/+41
|
* bpo-30103: Allow Uuencode in Python using backtick as zero instead of space ↵Xiang Zhang2017-05-032-46/+73
| | | | | | (#1326)
* Fix tests: getsockname() can return None on OS X on unbound sockets (#1400)Antoine Pitrou2017-05-021-2/+2
|
* Remove outdated tests in test_isinstance (GH-1393)Jim Fasarakis-Hilliard2017-05-021-17/+1
| | | There is no need to test for new-style classes versus classic classes in Python 3.
* bpo-28556: Routine updates to typing (#1366)Ivan Levkivskyi2017-05-021-5/+46
| | | | | - Add NoReturn type - Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard) - Minor bug-fixes
* bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)Antoine Pitrou2017-05-021-0/+4
| | | | | | * bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux * Add NEWS entry
* bpo-30199: test_ssl closes all asyncore channels (#1381)Victor Stinner2017-05-021-1/+3
| | | | | | | | | | | | AsyncoreEchoServer of test_ssl now calls asyncore.close_all(ignore_all=True) to ensure that asyncore.socket_map is cleared once the test completes, even if ConnectionHandler was not correctly unregistered. Fix the following warning: Warning -- asyncore.socket_map was modified by test_ssl Before: {} After: {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}
* bpo-29679: Implement @contextlib.asynccontextmanager (#360)Jelle Zijlstra2017-05-011-0/+212
|
* bpo-30158: Fix deprecation warnings in test_importlib introduced by ↵Serhiy Storchaka2017-04-291-13/+16
| | | | bpo-29576. (#1285)
* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. ↵Serhiy Storchaka2017-04-283-13/+37
| | | | | | | | | | | | | (#1341) * bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. They now work when delete replaced attribute or item inside the with statement. The old value of the attribute or item (or None if it doesn't exist) now will be assigned to the target of the "as" clause, if there is one. * Update docstrings.
* bpo-30175: Skip client cert tests of test_imaplib (#1320)Victor Stinner2017-04-272-1/+12
| | | | | | | | | | | | | * bpo-30175: Skip client cert tests of test_imaplib The IMAP server cyrus.andrew.cmu.edu doesn't accept our randomly generated client x509 certificate anymore. * bpo-30188: Catch EOFError in NetworkedNNTPTests test_nntplib fails randomly with EOFError in NetworkedNNTPTests.setUpClass(). Catch EOFError to skip tests in that case.
* bpo-30131: test_logging now joins queue threads (#1298)Victor Stinner2017-04-261-0/+8
| | | | | | | | QueueListenerTest of test_logging now closes the multiprocessing Queue and joins its thread to prevent leaking dangling threads to following tests. Add also @support.reap_threads to detect earlier if a test leaks threads (and try to "cleanup" these threads).
* bpo-30107: Make SuppressCrashReport quiet on macOS (#1279)Victor Stinner2017-04-251-4/+9
| | | | | | | | | On macOS, SuppressCrashReport now redirects /usr/bin/defaults command stderr into a pipe to not pollute stderr. It fixes a test_io.test_daemon_threads_shutdown_stderr_deadlock() failure when the CrashReporter domain doesn't exists. Message logged into stderr: 2017-04-24 16:57:21.432 defaults[41046:2462851] The domain/default pair of (com.apple.CrashReporter, DialogType) does not exist
* bpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926)Jim Fasarakis-Hilliard2017-04-251-4/+4
|
* bpo-30131: Cleanup threads in test_logging (#1275)Victor Stinner2017-04-241-0/+15
| | | | * Use @support.reap_threads on unit tests creating threads * Call TestCase.fail() on thread.join(timeout) failure
* bpo-29822: Make inspect.isabstract() work during __init_subclass__. (#678)Nate2017-04-241-0/+24
| | | | | | | At the time when an abstract base class' __init_subclass__ runs, ABCMeta.__new__ has not yet finished running, so in the presence of __init_subclass__, inspect.isabstract() can no longer depend only on TPFLAGS_IS_ABSTRACT.
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-246-59/+61
| | | | collections. (#1263)
* bpo-29960 _random.Random corrupted on exception in setstate(). (#1019)bladebryan2017-04-221-0/+5
|
* bpo-30125: disable faulthandler in ctypes test_SEH (#1237)Victor Stinner2017-04-211-0/+16
| | | | | | | | Disable faulthandler to run test_SEH() of test_ctypes to prevent the following log with a traceback: Windows fatal exception: access violation Add support.disable_faulthandler() context manager.
* bpo-30125: Fix faulthandler.disable() on Windows (#1240)Victor Stinner2017-04-211-0/+12
| | | | | | | | | | | | * bpo-30125: Cleanup faulthandler.c * Use size_t type for iterators * Add { ... } * bpo-30125: Fix faulthandler.disable() on Windows On Windows, faulthandler.disable() now removes the exception handler installed by faulthandler.enable().
* bpo-30107: don't dump core on expected test_io crash (#1235)Victor Stinner2017-04-211-0/+5
| | | | | | | | | | | | | | test_io has two unit tests which trigger a deadlock: * test_daemon_threads_shutdown_stdout_deadlock() * test_daemon_threads_shutdown_stderr_deadlock() These tests call Py_FatalError() if the expected bug is triggered which calls abort(). Use test.support.SuppressCrashReport to prevent the creation on a core dump, to fix the warning: Warning -- files was modified by test_io Before: [] After: ['python.core']
* bpo-30106: Fix test_asyncore.test_quick_connect() (#1234)Victor Stinner2017-04-211-1/+2
| | | | | | | | | | test_quick_connect() runs a thread up to 50 seconds, whereas the socket is connected in 0.2 second and then the thread is expected to end in less than 3 second. On Linux, the thread ends quickly because select() seems to always return quickly. On FreeBSD, sometimes select() fails with timeout and so the thread runs much longer than expected. Fix the thread timeout to fix a race condition in the test.
* bpo-29802: Fix reference counting in module-level struct functions (#1213)Serhiy Storchaka2017-04-201-0/+10
| | | | when pass arguments of wrong type.
* support.threading_cleanup() log a warning on fail (#1195)Victor Stinner2017-04-202-2/+9
| | | | | | | | | | | | 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
* bpo-30108: Restore sys.path in test_site (#1197)Victor Stinner2017-04-201-8/+21
| | | | | | Add setUpModule() and tearDownModule() functions to test_site to save/restore sys.path at the module level to prevent warning if the user site directory is created, since site.addsitedir() modifies sys.path.
* bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168)Dong-hee Na2017-04-201-3/+5
|
* bpo-30109: Fix reindent.py (GH-1207)Mariatta2017-04-201-0/+7
| | | Skip the file if it has bad encoding.
* bpo-30106: Fix tearDown() of test_asyncore (#1194)Victor Stinner2017-04-201-2/+2
| | | | | | | | | Call asyncore.close_all() with ignore_all=True in the tearDown() method of the test_asyncore base test case. It should prevent keeping alive sockets in asyncore.socket_map if close() fails with an unexpected error. Revert also an unwanted change of my previous commit: remove name parameter of Thread in test_quick_connect().
* bpo-29887: test_normalization handles PermissionError (#1196)Victor Stinner2017-04-201-0/+3
| | | | Skip test_normalization.test_main() if download raises a permission error.
* regrtest: always show before/after of modified env (#1192)Victor Stinner2017-04-191-3/+2
| | | | | | | | Buildbots don't run tests with -vv and so only log "xxx was modified by test_xxx" which is not enough to debug such random issue. In many cases, I'm unable to reproduce the warning and so unable to fix it. Always logging the value before and value after should help to debug such warning on buildbots.
* Fix/optimize test_asyncore.test_quick_connect() (#1188)Victor Stinner2017-04-191-39/+38
| | | | | | | | | | | | | | Don't use addCleanup() in test_quick_connect() because it keeps the Thread object alive and so @reap_threads fails on its timeout of 1 second. "./python -m test -v test_asyncore -m test_quick_connect" now takes 185 ms, instead of 11 seconds. Other minor changes: * Use "with sock:" to close the socket instead of try/finally: sock.close() * Use self.skipTest() in test_quick_connect() to remove one indentation level and notice user that the test is specific to AF_INET and AF_INET6
* bpo-30030: Revert f50354ad (tempfile) (#1187)Victor Stinner2017-04-191-3/+2
| | | | Revert f50354adaaafebe95ad09d09b825804a686ea843: it introduced a regression in test_threadedtempfile.
* bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)Serhiy Storchaka2017-04-192-4/+15
|
* bpo-30070: Fixed leaks and crashes in errors handling in the parser module. ↵Serhiy Storchaka2017-04-191-0/+81
| | | | (#1131)
* bpo-22352: Adjust widths in the output of dis.dis() for large line numbers ↵Serhiy Storchaka2017-04-191-1/+51
| | | | | | | and (#1153) instruction offsets. Add tests for widths of opcode names.
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-0/+16
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971)Victor Stinner2017-04-191-0/+3
|
* Fix minor typos (GH-1173)cocoatomo2017-04-191-1/+1
|
* bpo-29514: Check magic number for bugfix release (#54)Eric Appelt2017-04-171-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-29514: Check magic number for micro release Add a dict importlib.util.EXPECTED_MAGIC_NUMBERS which details the initial and expected pyc magic number for each minor release. This gives a mechanism for users to check if the magic number has changed within a release and for a test to ensure procedure is followed if a change is necessary. Add a test to check the current MAGIC_NUMBER against the expected number for the release if the current release is at candidate or final level. On test failure, describe to the developer the procedure for changing the magic number. * Simplify magic number release test Simplify the magic number release test by removing EXPECTED_MAGIC_NUMBERS table and making the expected magic number self-contained within the test. BPO: 29514 * Improve magic number test execution and message Improve the execution of the magic number test by using skipUnless for alpha and beta releases, and directly inheriting from unittest.TestCase rather than using the machinery for the other tests. Also improve the error message to explain the reason for caution in changing the magic number. BPO: 29514
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-1/+1
|
* bpo-10076: Compiled regular expression and match objects now are copyable. ↵Serhiy Storchaka2017-04-161-0/+9
| | | | (#1000)
* bpo-29839: Raise ValueError rather than OverflowError in len() for negative ↵Serhiy Storchaka2017-04-161-0/+8
| | | | values. (#701)
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-0/+1
| | | | present (#1130)
* Relax test timing (bpo-29861) to avoid sporadic failures (#1120)Antoine Pitrou2017-04-141-0/+1
|
* bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089)Armin Rigo2017-04-131-0/+30
|
* bpo-29995: re.escape() now escapes only special characters. (#1007)Serhiy Storchaka2017-04-131-18/+19
|
* bpo-30017: Allowed calling the close() method of the zip entry writer object ↵Serhiy Storchaka2017-04-121-0/+42
| | | | | | (#1041) multiple times. Writing to closed zip entry writer object now always produce a ValueError.
* Reimplement tempfile._RandomNameSequence using a generator function. (#1075)Serhiy Storchaka2017-04-111-2/+3
|