aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test
Commit message (Collapse)AuthorAge
* bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. (#4827)Yury Selivanov2017-12-13
| | | | | | | | asyncio.get_event_loop(), and, subsequently asyncio._get_running_loop() are one of the most frequently executed functions in asyncio. They also can't be sped up by third-party event loops like uvloop. When implemented in C they become 4x faster.
* pythoninfo: Add builtins, test.support, ... (#4840)Victor Stinner2017-12-13
| | | | | | Collect more info from builtins, resource, test.test_socket and test.support modules. Co-Authored-By: Christian Heimes <christian@python.org>
* Fix couple typos (#4839)Andrew Svetlov2017-12-13
|
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-13
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* Test atexit shutdown mechanism in a subprocess (#4828)Antoine Pitrou2017-12-13
| | | | * Test atexit shutdown mechanism in a subprocess
* bpo-32101: Fix tests for PYTHONDEVMODE=1 (#4821)Victor Stinner2017-12-12
| | | | test_asycio: remove also aio_path which was used when asyncio was developed outside the stdlib.
* bpo-32230: Set sys.warnoptions with -X dev (#4820)Victor Stinner2017-12-12
| | | | | | | | | | | | | | Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
* Fix improper use of re.escape() in tests. (#4814)Serhiy Storchaka2017-12-12
|
* Fix implementation dependent assertion in test_plistlib. (#4813)Serhiy Storchaka2017-12-12
| | | It is failed with an advanced optimizer.
* bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)Licht Takeuchi2017-12-12
| | | This allows to distinguish an empty row from a row consisting of a single empty field.
* bpo-32227: functools.singledispatch supports registering via type ↵Łukasz Langa2017-12-11
| | | | annotations (#4733)
* Add asyncio.get_running_loop() function. (#4782)Yury Selivanov2017-12-11
|
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-11
|
* bpo-22671: Clarify and test default read method implementations (#4568)Sanyam Khurana2017-12-11
| | | Original patch written by Martin Panter, enhanced by Sanyam Khurana.
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-10
|
* Skip test_read_pty_output test on macOS for poll and select. (#4774)Yury Selivanov2017-12-10
| | | Starting with 10.13.2 the test hangs forever.
* bpo-31506: Improve the error message logic for class instantiation (GH-4740)Sanyam Khurana2017-12-10
| | | | | | | | | | | | The error messages in `object.__new__` and `object.__init__` now aim to point the user more directly at the name of the class being instantiated in cases where they *haven't* been overridden (on the assumption that the actual problem is a missing `__new__` or `__init__` definition in the class body). When they *have* been overridden, the errors still report themselves as coming from object, on the assumption that the problem is with the call up to the base class in the method implementation, rather than with the way the constructor is being called.
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* bpo-32253: Deprecate with statement and bare await for asyncio locks (GH-4764)Andrew Svetlov2017-12-09
| | | | | * Add test for 'with (yield from lock)' * Deprecate with statement for asyncio locks * Document the deprecation
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* bpo-32208: update threading.Semaphore docs and add unit test (#4709)Garrett Berg2017-12-07
| | | | | | | | | | * fix issue32208: update threading.Semaphore docs and add unit test to validate correct behavior * add test for blocking * Update threading.rst * semaphore: remove documentation validation tests and move 'return value' test to BaseSemaphore
* Fix hardcoded value in test_os.py (#4744)Pablo Galindo2017-12-07
|
* Use raw strings for regex to avoid invalid escape sequences. (GH-4741)Eric V. Smith2017-12-06
|
* bpo-31380: Skip test_httpservers test_undecodable_file on macOS. (#4720)Ned Deily2017-12-04
| | | The undecodable file name cannot be created on macOS APFS file systems.
* [bpo-28556] Minor fixes for typing module (#4710)Ivan Levkivskyi2017-12-04
|
* bpo-32214: Implement PEP 557: Data Classes (#4704)Eric V. Smith2017-12-04
|
* bpo-25054, bpo-1647489: Added support of splitting on zerowidth patterns. ↵Serhiy Storchaka2017-12-04
| | | | | | (#4471) Also fixed searching patterns that could match an empty string.
* Fix a regression in uuid added in bpo-32107. (#4677)Serhiy Storchaka2017-12-04
| | | | | uuid.get_node() always must return a stable result. Also added a test for non-reproducibility of _random_getnode(). Original patch by Xavier de Gaye.
* bpo-27240 Rewrite the email header folding algorithm. (#3488)R. David Murray2017-12-03
| | | | | | | | | | | | | | | | | | | | | The original algorithm tried to delegate the folding to the tokens so that those tokens whose folding rules differed could specify the differences. However, this resulted in a lot of duplicated code because most of the rules were the same. The new algorithm moves all folding logic into a set of functions external to the token classes, but puts the information about which tokens can be folded in which ways on the tokens...with the exception of mime-parameters, which are a special case (which was not even implemented in the old folder). This algorithm can still probably be improved and hopefully simplified somewhat. Note that some of the test expectations are changed. I believe the changes are toward more desirable and consistent behavior: in general when (re) folding a line the canonical version of the tokens is generated, rather than preserving errors or extra whitespace.
* bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)Serhiy Storchaka2017-12-03
| | | | | instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
* bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)Nick Coghlan2017-12-03
| | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined.
* Add a minimal unit test for Python/frozen.c. (#2995)Neil Schemenauer2017-12-02
| | | | | | If the marshal or bytecode formats get changed, frozen.c needs to be updated as well. It can be easy to miss this step and not doing so can cause test_importlib to crash in mysterious ways. Add an explict unit test to make it easier to track down the problem.
* bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)xdegaye2017-12-01
| | | | Skip tests with test.support.import_module('multiprocessing.synchronize') instead when the semaphore implementation is broken or missing.
* bpo-10544: Deprecate "yield" in comprehensions and generator expressions. ↵Serhiy Storchaka2017-12-01
| | | | | | | | | | | | | | (GH-4579) The current behaviour of yield expressions inside comprehensions and generator expressions is essentially an accident of implementation - it arises implicitly from the way the compiler handles yield expressions inside nested functions and generators. Since the current behaviour wasn't deliberately designed, and is inherently confusing, we're deprecating it, with no current plans to reintroduce it. Instead, our advice will be to use a named nested generator definition for cases where this behaviour is desired.
* bpo-32072: Fix issues with binary plists. (#4455)Serhiy Storchaka2017-11-30
| | | | | | | * Fixed saving bytearrays. * Identical objects will be saved only once. * Equal references will be load as identical objects. * Added support for saving and loading recursive data structures.
* bpo-20891: Fix PyGILState_Ensure() (#4650)Victor Stinner2017-11-30
| | | | | | | When PyGILState_Ensure() is called in a non-Python thread before PyEval_InitThreads(), only call PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. Add an unit test in test_embed.
* bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (#4080)Serhiy Storchaka2017-11-30
| | | | with the persistent_id() and persistent_load() methods.
* Skip test_socket.test_sha256() on linux < 4.5 (#4643)Victor Stinner2017-11-30
| | | bpo-31705.
* bpo-32101: Add PYTHONDEVMODE environment variable (#4624)Victor Stinner2017-11-30
| | | | | | * bpo-32101: Add sys.flags.dev_mode flag Rename also the "Developer mode" to the "Development mode". * bpo-32101: Add PYTHONDEVMODE environment variable Mention it in the development chapiter.
* bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format ↵Jesse-Bakker2017-11-30
| | | | | | | | (#4534) * Add most_recent_first parameter to tracemalloc.Traceback.format to allow reversing the order of the frames in the output * Reversed default sorting of tracemalloc.Traceback frames * Allowed negative limit, truncating from the other side.
* bpo-32166: Drop Python 3.4 code from asyncio (#4612)Andrew Svetlov2017-11-29
| | | | | | | | | | | | | | | | | | | | | | * Drop Python 3.4 code from asyncio * Fix notes * Add missing imports * Restore comment * Resort imports * Drop Python 3.4-3.5 specific code * Drop redunant check * Fix tests * Restore _COROUTINE_TYPES order * Remove useless code
* bpo-32030: Rework memory allocators (#4625)Victor Stinner2017-11-29
| | | | | | | | | | | | | | | | | | | | * Fix _PyMem_SetupAllocators("debug"): always restore allocators to the defaults, rather than only caling _PyMem_SetupDebugHooks(). * Add _PyMem_SetDefaultAllocator() helper to set the "default" allocator. * Add _PyMem_GetAllocatorsName(): get the name of the allocators * main() now uses debug hooks on memory allocators if Py_DEBUG is defined, rather than calling directly malloc() * Document default memory allocators in C API documentation * _Py_InitializeCore() now fails with a fatal user error if PYTHONMALLOC value is an unknown memory allocator, instead of failing with a fatal internal error. * Add new tests on the PYTHONMALLOC environment variable * Add support.with_pymalloc() * Add the _testcapi.WITH_PYMALLOC constant and expose it as support.with_pymalloc(). * sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so replace it with support.with_pymalloc(). * pythoninfo: add _testcapi collector for pymem
* test_socket: socket.socketpair() is always available (#4634)Victor Stinner2017-11-29
|
* bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV (GH-4604)xdegaye2017-11-29
| | | | Remove the test.support.requires_android_level decorator.
* bpo-32139: test_strftime does not anymore modify the locale (GH-4569)xdegaye2017-11-29
|
* bpo-32110: codecs.StreamReader.read(n) now returns not more than n (#4499)Serhiy Storchaka2017-11-29
| | | | | characters/bytes for non-negative n. This makes it compatible with read() methods of other file-like objects.
* bpo-32107 - Improve MAC address calculation and fix test_uuid.py (#4600)Barry Warsaw2017-11-28
| | | | | | | | ``uuid.getnode()`` now preferentially returns universally administered MAC addresses if available, over locally administered MAC addresses. This makes a better guarantee for global uniqueness of UUIDs returned from ``uuid.uuid1()``. If only locally administered MAC addresses are available, the first such one found is returned. Also improve internal code style by being explicit about ``return None`` rather than falling off the end of the function. Improve the test robustness.
* bpo-32159: Remove tools for CVS and Subversion (#4615)Victor Stinner2017-11-28
| | | | | | | | | | CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are not more used to develop CPython. * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py
* bpo-32157: Removed explicit quotes around %r and {!r}. (#4582)Serhiy Storchaka2017-11-28
|
* bpo-32154: Remove asyncio.windows_utils.socketpair (#4609)Victor Stinner2017-11-28
|