summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.6] bpo-30584: Fix test_os fails on non-English Windows (GH-1980) (#1999)Denis Osipov2017-06-081-1/+3
| | | | | | | | * Fix bpo-30584 * Adding a comment mentionning the bpo and explaining what is the identifier * Add Denis Osipov to Misc/ACKS (cherry picked from commit 897bba75632dfce87c355e3cd4700468357715a7)
* bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893) ↵Antoine Pietri2017-06-071-9/+12
| | | | (#1985)
* [3.6] bpo-29822: make inspect.isabstract() work during __init_subclass__ (#1979)Nate2017-06-071-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. (cherry picked from commit fcfe80ec2592fed8b3941c79056a8737abef7d3b)
* bpo-29581: bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ ↵Nate2017-06-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-527) (GH-1282) Many metaclasses in the standard library don't play nice with __init_subclass__. This bug makes ABCMeta in particular with __init_subclass__, which is an 80/20 solution for me personally. AFAICT, a general solution to this problem requires updating all metaclasses in the standard library to make sure they pass **kwargs to type.__new__, whereas this PR only fixes ABCMeta. For context, see https://bugs.python.org/issue29581. * added a test combining ABCMeta and __init_subclass__ * Added NEWS item (cherry picked from commit bd583ef9857d99f9145ad0bb2c4424cc0baa63fc) * [3.6] bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-527) Many metaclasses in the standard library don't play nice with __init_subclass__. This bug makes ABCMeta in particular with __init_subclass__, which is an 80/20 solution for me personally. AFAICT, a general solution to this problem requires updating all metaclasses in the standard library to make sure they pass **kwargs to type.__new__, whereas this PR only fixes ABCMeta. For context, see https://bugs.python.org/issue29581. * added a test combining ABCMeta and __init_subclass__ * Added NEWS item. (cherry picked from commit bd583ef9857d99f9145ad0bb2c4424cc0baa63fc) * **kwargs -> ``kwargs`` in attempts to fix the Travis build. * Quote the **kwargs
* [3.6] bpo-30557: faulthandler now correctly filters and displays exception ↵Steve Dower2017-06-061-0/+28
| | | | | | | | | | | | | | | | | … (#1960) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (#1924) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows * Adds test for non-fatal exceptions. * Adds bpo number to comment. * bpo-30557: Fix test_faulthandler (#1969) On Windows 8, 8.1 and 10 at least, the exit code is the exception code (no bit is cleared).
* [3.6] Fix skipping test_UNC_path on AppVeyor due to a different error being ↵Zachary Ware2017-06-041-1/+1
| | | | | | | raised (GH-1920) We get `ERROR_BAD_NETPATH` (53) on AppVeyor which is translated to ENOENT (2). (cherry picked from commit 7a99625e0d95cd88ed8842d8677b5beea1fde5ae)
* bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses ↵Xiang Zhang2017-06-011-2/+20
| | | | (#1676) (#1903)
* [3.6] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1287)Mariatta2017-05-271-0/+5
| | | (cherry picked from commit 9616a82e7802241a4b74cf7ae38d43c37bf66e48)
* [3.6] bpo-30414: multiprocessing.Queue._feed do not break from main loop on ↵Antoine Pitrou2017-05-251-0/+14
| | | | | | | | | | | | | | | | | | exc (GH-1683) (#1815) * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored. * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored. (cherry picked from commit bc50f03db4f58c869b78e98468e374d7e61f1227)
* [3.6] bpo-29104: Fixed parsing backslashes in f-strings. (GH-490) (#1812)Serhiy Storchaka2017-05-251-0/+14
| | | (cherry picked from commit 0cd7a3f)
* bpo-30003: Fix handling escape characters in HZ codec (#1556) (#1719)Xiang Zhang2017-05-221-0/+4
|
* [3.6] bpo-30415: Add new tests for the fnmatch module. (GH-1684) (#1694)Serhiy Storchaka2017-05-211-9/+55
| | | (cherry picked from commit 8175547)
* [3.6] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1677)Serhiy Storchaka2017-05-201-0/+85
| | | | Based on patches by Duane Griffin and Tim Mitchell. (cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)
* [3.6] bpo-25794: Fix `type.__setattr__()` for non-interned attribute names. ↵Serhiy Storchaka2017-05-201-0/+27
| | | | | | | (GH-1652) (#1673) Based on patch by Eryk Sun. (cherry picked from commit d896985bb2de49046f9b6879e906d1e4db255e23)
* bpo-27103: regrtest disables -W if -R is used (#1651) (#1656)Victor Stinner2017-05-181-0/+5
| | | | Workaround for a regrtest bug. (cherry picked from commit fcdd9b6b7e73427ce5aa63cf095312f603c4edce)
* bpo-30387: Fix warning in test_threading (#1634) (#1636)Victor Stinner2017-05-171-3/+5
| | | | | | | | | | test_is_alive_after_fork() now joins directly the thread to avoid the following warning added by bpo-30357: Warning -- threading_cleanup() failed to cleanup 0 threads after 2 sec (count: 0, dangling: 21) Use also a different exit code to catch generic exit code 1. (cherry picked from commit f8d05b3a24e745ab4a974b891ac1389e2f11ce4d)
* Remove unused variable in test_urllibnet. (#1598) (#1600)Senthil Kumaran2017-05-171-1/+3
| | | (cherry picked from commit 1bd7d299bd2a91f8267f97a413568ab8fe7fdfbb)
* bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601) (#1628)Xiang Zhang2017-05-171-0/+36
| | | | Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could raise AttributeError due to not setting _poll in __setstate__.
* bpo-30357: test_thread now uses threading_cleanup() (#1592) (#1622)Victor Stinner2017-05-171-0/+4
| | | | | | | | test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Co-Authored-By: Grzegorz Grzywacz <grzegorz.grzywacz@nazwa.pl> (cherry picked from commit 79ef7f8e88a4972c4aecf95cfc5cd934f1861e08)
* [3.6] bpo-30375: Correct the stacklevel of regex compiling warnings. ↵Serhiy Storchaka2017-05-161-3/+14
| | | | | | | | | (GH-1595) (#1604) Warnings emitted when compile a regular expression now always point to the line in the user code. Previously they could point into inners of the re module if emitted from inside of groups or conditionals.. (cherry picked from commit c7ac7280c321b3c1679fe5f657a6be0f86adf173)
* bpo-30110: fix resource leak in test_asyncio.test_events (#1413) (#1584)Xiang Zhang2017-05-151-1/+3
|
* [3.6] bpo-30345: Update test_gdb.py and python-gdb.py from master (#1549)Victor Stinner2017-05-121-2/+20
| | | | | | | | | | | | | | * python-gdb.py supports method-wrapper bpo-29367: python-gdb.py now supports also method-wrapper (wrapperobject) objects. (cherry picked from commit 611083331d534481ca7956a376e38fb0e9ef3854) * Update and enhance python-gdb.py bpo-29259: Detect PyCFunction is the current frame, not only in the older frame.
* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1546)INADA Naoki2017-05-111-0/+18
| | | | | | | | | | | | | | when there are no more `await` or `yield (from)` before return in coroutine, cancel was ignored. example: async def coro(): asyncio.Task.current_task().cancel() return 42 ... res = await coro() # should raise CancelledError (cherry picked from commit 991adca012f5e106c2d4040ce619c696ba6f9c46)
* bpo-30320: test_eintr now uses pthread_sigmask() (#1523) (#1524)Victor Stinner2017-05-101-30/+26
| | | | | | | | | | | | | Rewrite sigwaitinfo() and sigtimedwait() unit tests for EINTR using pthread_sigmask() to fix a race condition between the child and the parent process. Remove the pipe which was used as a weak workaround against the race condition. sigtimedwait() is now tested with a child process sending a signal instead of testing the timeout feature which is more unstable (especially regarding to clock resolution depending on the platform). (cherry picked from commit 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f)
* [3.6] bpo-30298: Weaken the condition of deprecation warnings for inline ↵Serhiy Storchaka2017-05-101-14/+45
| | | | | | | | | modifiers. (GH-1490) (#1525) Now allowed several subsequential inline modifiers at the start of the pattern (e.g. '(?i)(?s)...'). In verbose mode whitespaces and comments now are allowed before and between inline modifiers (e.g. '(?x) (?i) (?s)...').. (cherry picked from commit 305ccbe27ea5ba82fd2d8c32ec739f980e524330)
* bpo-29990: Fix range checking in GB18030 decoder (#1495) (#1507)Xiang Zhang2017-05-091-0/+6
| | | When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.
* bpo-30264: ExpatParser closes the source on error (#1451) (#1474)Victor Stinner2017-05-051-6/+18
| | | | | | | | | ExpatParser.parse() of xml.sax.xmlreader now always closes the source: close the file object or the urllib object if source is a string (not an open file-like object). The change fixes a ResourceWarning on parsing error. Add test_parse_close_source() unit test. (cherry picked from commit ef9c0e732fc50aefbdd7c5a80e04e14b31684e66)
* [3.6] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. ↵Serhiy Storchaka2017-05-041-18/+41
| | | | | (GH-1316). (#1441) (cherry picked from commit 5f161fd86dd5bb936a1a2a13391b13b7e59ec201)
* [3.6] bpo-28556: Routine updates to typing (GH-1366) (#1416)Mariatta2017-05-031-5/+46
| | | | | | - Add NoReturn type - Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard) - Minor bug-fixes (cherry picked from commit f06e0218ef6007667f5d61184b85a81a0466d3ae)
* regrtest: always show before/after of modified env (#1192) (#1406)Victor Stinner2017-05-031-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. (cherry picked from commit ec4b17239d899550be4ee6104b61751bb3c70382)
* Backport bpo-30205 to 3.6 (#1403)Antoine Pitrou2017-05-021-0/+4
|
* bpo-30199: test_ssl closes all asyncore channels (#1381) (#1390)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>} (cherry picked from commit 1dae7450c68bad498e57800387b24cb103c461fa)
* bpo-30108: Restore sys.path in test_site (#1197) (#1378)Victor Stinner2017-05-021-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. (cherry picked from commit b85c136903c6d2368162f7c4a58f258c9c69ead0)
* [3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in ↵Serhiy Storchaka2017-04-283-13/+37
| | | | | | | | | | | test.support. (GH-1341) (#1345) 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. (cherry picked from commit d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83)
* bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343)Victor Stinner2017-04-281-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. (cherry picked from commit a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d)
* bpo-30131: test_logging now joins queue threads (#1298) (#1317)Victor Stinner2017-04-281-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). (cherry picked from commit 8ca2f2faefa8dba323a2e4c4b86efb633d7a53cf)
* [3.6] bpo-30106: Fix test_asyncore.test_quick_connect() (#1336)Victor Stinner2017-04-281-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix/optimize test_asyncore.test_quick_connect() (#1188) 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-30106: Fix tearDown() of test_asyncore (#1194) 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-30106: Fix test_asyncore.test_quick_connect() (#1234) 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-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335)Victor Stinner2017-04-281-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 (cherry picked from commit d819ad9832292d854e9710493ecdf959b69802e3)
* bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323)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. (cherry picked from commit 5bccca58b9b2b3a925b16750bedbd907695ea8d7)
* bpo-30125: Fix faulthandler.disable() on Windows (#1243)Victor Stinner2017-04-211-0/+12
| | | | 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) (#1241)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'] (cherry picked from commit 2a1aed04b0943636f605543522e16cca1dc23e70)
* [3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208)Mariatta2017-04-201-0/+7
| | | | Skip the file if it has bad encoding. (cherry picked from commit 58f3c9dc8f5626abe09ac9738c34f6ba99ce2972)
* [3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. ↵Dong-hee Na2017-04-201-3/+5
| | | | (#1168) (#1198)
* [3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). ↵Serhiy Storchaka2017-04-192-4/+15
| | | | | (GH-1110) (#1186) (cherry picked from commit 66bffd1)
* [3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser ↵Serhiy Storchaka2017-04-191-0/+81
| | | | | module. (GH-1131). (#1184) (cherry picked from commit a79f4c219531c05fc8f670c1e4bbf12c081935d3)
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ↵Serhiy Storchaka2017-04-191-0/+16
| | | | | | | (#1096) (#1180) raised an error. (cherry picked from commit bf623ae8843dc30b28c574bec8d29fc14be59d86)
* bpo-30017: Allowed calling the close() method of the zip entry writer object ↵Serhiy Storchaka2017-04-161-0/+42
| | | | | | | (#1041) (#1092) multiple times. Writing to closed zip entry writer object now always produce a ValueError. (cherry picked from commit 4c0d9ea995da595e90e08813b89510de59907802)
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-0/+1
| | | | present (#1130) (#1150)
* Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1132)Antoine Pitrou2017-04-141-0/+1
| | | (cherry picked from commit 685cdb9acc3fca04a9897d88b89771ddfd50e772)
* [3.6] bpo-29694: race condition in pathlib mkdir with flags parents=True ↵Mariatta2017-04-141-0/+30
| | | | | (GH-1089). (GH-1126) (cherry picked from commit 22a594a0047d7706537ff2ac676cdc0f1dcb329c)