summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Oren Milman2017-09-111-0/+15
| | | | | warnings.defaultaction. (#3496) Patch by Oren Milman.
* test_ssl: Implement timeout in ssl_io_loop() (#3500)Victor Stinner2017-09-111-0/+3
| | | The timeout parameter was not used.
* bpo-31373: remove overly strict float range checks (#3486)Benjamin Peterson2017-09-112-0/+12
| | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior.
* bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is ↵Oren Milman2017-09-111-0/+11
| | | | not a dictionary. (#3485)
* bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() ↵Raymond Hettinger2017-09-101-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#3454) * Working draft without _source * Re-use itemgetter() instances * Speed-up calls to __new__() with a pre-bound tuple.__new__() * Add note regarding string interning * Remove unnecessary create function wrappers * Minor sync-ups with PR-2736. Mostly formatting and f-strings * Bring-in qualname/__module fix-ups from PR-2736 * Formally remove the verbose flag and _source attribute * Restore a test of potentially problematic field names * Restore kwonly_args test but without the verbose option * Adopt Inada's idea to reuse the docstrings for the itemgetters * Neaten-up a bit * Add news blurb * Serhiy pointed-out the need for interning * Jelle noticed as missing f on an f-string * Add whatsnew entry for feature removal * Accede to request for dict literals instead keyword arguments * Leave the method.__module__ attribute pointing the actual location of the code * Improve variable names and add a micro-optimization for an non-public helper function * Simplify by in-lining reuse_itemgetter() * Arrange steps in more logical order * Save docstring in local cache instead of interning
* bpo-29639: change test.support.HOST to "localhost"Gregory P. Smith2017-09-094-34/+46
| | | | | | | | | | test.support.HOST should be "localhost" as it was in the past. See the bpo-29639. Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant. This changes the definition and fixes tests that needed updating to deal with HOST being the hostname rather than the hardcoded IP address. This is only the first step in addressing https://bugs.python.org/issue29639.
* bpo-26669: Fix nan arg value error in pytime.c (#3085)Han Lee2017-09-081-0/+29
| | | | | | | | | | * Fix #26669 * Modify NaN check function and error message * Fix pytime.c when arg is nan * fix whitespace
* bpo-28182: Expose OpenSSL verification results (#3412)Christian Heimes2017-09-081-0/+23
| | | | | | | | | The SSL module now raises SSLCertVerificationError when OpenSSL fails to verify the peer's certificate. The exception contains more information about the error. Original patch by Chi Hsuan Yen Signed-off-by: Christian Heimes <christian@python.org>
* bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)Christian Heimes2017-09-081-0/+32
| | | | | | | | | | | | | | | | * bpo-29136: Add TLS 1.3 support TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3 cipher suites don't overlap with cipher suites from TLS 1.2 and earlier. Since Python sets its own set of permitted ciphers, TLS 1.3 handshake will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common AES-GCM and ChaCha20 suites. Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3 now. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-082-5/+53
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* bpo-27340: Use memoryview in SSLSocket.sendall() (#3384)Christian Heimes2017-09-071-1/+11
| | | | | | | | | | | | | | * bpo-27340: Use memoryview in SSLSocket.sendall() SSLSocket.sendall() now uses memoryview to create slices of data. This fix support for all bytes-like object. It is also more efficient and avoids costly copies. Signed-off-by: Christian Heimes <christian@python.org> * Cast view to bytes, fix typo Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-0759-2825/+2193
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)Łukasz Langa2017-09-071-0/+248
| | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
* bpo-14191 Add parse_intermixed_args. (#3319)R. David Murray2017-09-071-0/+87
| | | This adds support for parsing a command line where options and positionals are intermixed as is common in many unix commands. This is paul.j3's patch with a few tweaks.
* Remove all mention of Windows IA-64 support (GH-3389)Zachary Ware2017-09-061-7/+0
| | | It was mostly removed long ago.
* bpo-27584: New addition of vSockets to the python socket module (#2489)caavery2017-09-061-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-27584: New addition of vSockets to the python socket module Support for AF_VSOCK on Linux only * bpo-27584: Fixes for V2 Fixed syntax and naming problems. Fixed #ifdef AF_VSOCK checking Restored original aclocal.m4 * bpo-27584: Fixes for V3 Added checking for fcntl and thread modules. * bpo-27584: Fixes for V4 Fixed white space error * bpo-27584: Fixes for V5 Added back comma in (CID, port). * bpo-27584: Fixes for V6 Added news file. socket.rst now reflects first Linux introduction of AF_VSOCK. Fixed get_cid in test_socket.py. Replaced PyLong_FromLong with PyLong_FromUnsignedLong in socketmodule.c Got rid of extra AF_VSOCK #define. Added sockaddr_vm to sock_addr. * bpo-27584: Fixes for V7 Minor cleanup. * bpo-27584: Fixes for V8 Put back #undef AF_VSOCK as it is necessary when vm_sockets.h is not installed.
* bpo-29505: Add fuzz tests for float(str), int(str), unicode(str) (#2878)Devin Jeanpierre2017-09-061-0/+23
| | | | | | | | | | | | | | | | | | | | | | Add basic fuzz tests for a few common builtin functions. This is an easy place to start, and these functions are probably safe. We'll want to add more fuzz tests later. Lets bootstrap using these. While the fuzz tests are included in CPython and compiled / tested on a very basic level inside CPython itself, the actual fuzzing happens as part of oss-fuzz (https://github.com/google/oss-fuzz). The reason to include the tests in CPython is to make sure that they're maintained as part of the CPython project, especially when (as some eventually will) they use internal implementation details in the test. (This will be necessary sometimes because e.g. the fuzz test should never enter Python's interpreter loop, whereas some APIs only expose themselves publicly as Python functions.) This particular set of changes is part of testing Python's builtins, tracked internally at Google by b/37562550. The _xxtestfuzz module that this change adds need not be shipped with binary distributions of Python.
* bpo-31178: Avoid concatenating bytes with str in subprocess error (#3066)Ammar Askar2017-09-061-0/+47
| | | Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath.
* bpo-29781: Fix SSLObject.version before handshake (#3364)Christian Heimes2017-09-061-0/+2
| | | | | | SSLObject.version() now correctly returns None when handshake over BIO has not been performed yet. Signed-off-by: Christian Heimes <christian@python.org>
* Stop test_xmlrpc from writing to sys.stderr (#3359)Christian Heimes2017-09-061-0/+4
| | | | | | | | One test case of test_xmlrpc uses HTTPServer with a subclass of BaseHTTPRequestHandler. The BaseRequestHandler class logs to sys.stderr by default. Override log_message() to not clobber test output. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31320: No traceback to sys.stderr in test_ssl (#3360)Christian Heimes2017-09-051-1/+4
| | | | | | | In case PROTOCOL_TLS_SERVER is used for both client context and server context, the test thread dies with OSError. Catch OSError to avoid traceback on sys.stderr Signed-off-by: Christian Heimes <christian@python.org>
* remove IRIX support (closes bpo-31341) (#3310)Benjamin Peterson2017-09-041-7/+6
| | | See PEP 11.
* bpo-1198569: Allow string.Template braced pattern to be different (#3288)Barry Warsaw2017-09-041-0/+24
| | | | | | | | * bpo-1198569: Allow the braced pattern to be different ``string.Template`` subclasses can optionally define ``braceidpattern`` if they want to specify different placeholder patterns inside and outside the braces. If None (the default) it falls back to ``idpattern``.
* bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)Christian Heimes2017-09-042-156/+0
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)Zhiming Wang2017-09-041-0/+13
| | | Fix fileinput with inplace=True to accept pathlib.Path objects.
* bpo-12383: Also ignore __PYVENV_LAUNCHER__ (#3278)Ned Deily2017-09-041-0/+1
| | | Used in macOS framework builds.
* Fix a c.f.as_completed() refleak previously introduced in bpo-27144 (#3270)Antoine Pitrou2017-09-031-1/+1
|
* bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076)Serhiy Storchaka2017-09-031-8/+37
|
* bpo-31323: Fix reference leak in test_ssl (#3263)Victor Stinner2017-09-011-2/+6
| | | | Store exceptions as string rather than object to prevent reference cycles which cause leaking dangling threads.
* bpo-31250, test_asyncio: fix EventLoopTestsMixin.tearDown() (#3264)Victor Stinner2017-09-011-2/+2
| | | | | | | Call doCleanups() to close the loop after calling executor.shutdown(wait=True): see TestCase.set_event_loop() of asyncio.test_utils. Replace also gc.collect() with support.gc_collect().
* bpo-27144: concurrent.futures as_complete and map iterators do not keep ↵Grzegorz Grzywacz2017-09-011-0/+48
| | | | | | | | | | reference to returned object (#1560) * bpo-27144: concurrent.futures as_complie and map iterators do not keep reference to returned object * Some nits. Improve wordings in docstrings and comments, and avoid relying on sys.getrefcount() in tests.
* bpo-31250, test_asyncio: fix dangling threads (#3252)Victor Stinner2017-09-012-1/+2
| | | | | | | * Explicitly call shutdown(wait=True) on executors to wait until all threads complete to prevent side effects between tests. * Fix test_loop_self_reading_exception(): don't mock loop.close(). Previously, the original close() method was called rather than the mock, because how set_event_loop() registered loop.close().
* bpo-31217: Fix regrtest -R for small integer (#3260)Victor Stinner2017-09-011-3/+11
| | | | | | | | Use a pool of integer objects toprevent false alarm when checking for memory block leaks. Fill the pool with values in -1000..1000 which are the most common (reference, memory block, file descriptor) differences. Co-Authored-By: Antoine Pitrou <pitrou@free.fr>
* bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() ↵Oren Milman2017-08-291-0/+17
| | | | | (#3226) if pathname.replace('/', '\\') returns non-string.
* bpo-31286, bpo-30024: Fixed stack usage in absolute imports with (#3217)Serhiy Storchaka2017-08-291-0/+17
| | | binding a submodule to a name.
* bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171)Oren Milman2017-08-291-0/+20
|
* bpo-30987 - Support for ISO-TP protocol in SocketCAN (#2956)Pier-Yves Lessard2017-08-281-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added support for CAN_ISOTP protocol * Added unit tests for CAN ISOTP * Updated documentation for ISO-TP protocol * Removed trailing whitespace in documentation * Added blurb NEWS.d file * updated Misc/ACKS * Fixed broken unit test that was using isotp const outside of skippable section * Removed dependecy over third party project * Added implementation for getsockname + unit tests * Missing newline at end of ACKS file * Accidentally inserted a type in ACKS file * Followed tiran changes review #1 recommendations * Added spaces after comma
* bpo-31072: Rename the new filter argument for zipapp.create_archive. (#3049)Paul Moore2017-08-261-5/+26
| | | | | | | bpo-31072: Rename the new filter argument for zipapp.create_archive (GH-3049) * Rename the new argument to "filter" * Improve tests for the new functionality * Add a "What's New" entry.
* bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (#3201)Oren Milman2017-08-251-0/+8
|
* Skip two tests not intended to pass on Windows. (#3202)Gregory P. Smith2017-08-251-0/+2
|
* bpo-22536: Set the filename in FileNotFoundError. (#3194)Gregory P. Smith2017-08-241-0/+10
| | | | Have the subprocess module set the filename in the FileNotFoundError exception raised on POSIX systems when the executable or cwd are missing.
* bpo-29741: Update some methods in the _pyio module to also accept integer ↵Oren Milman2017-08-241-0/+28
| | | | types. Patch by Oren Milman. (#560)
* bpo-23835: Restore legacy defaults= behavior for RawConfigParser (#3191)Łukasz Langa2017-08-241-9/+18
| | | | | | | The fix for bpo-23835 fixed ConfigParser behavior in defaults= handling. Unfortunately, it caused a backwards compatibility regression with RawConfigParser objects which allow for non-string values. This commit restores the legacy behavior for RawConfigParser only.
* bpo-31229: Fixed wrong error messages when too many keyword arguments are ↵Oren Milman2017-08-231-0/+21
| | | | received. (#3180)
* bpo-31161: only check for parens error for SyntaxError (#3082)Martijn Pieters2017-08-221-0/+28
| | | | Subclasses such as IndentError and TabError should not have this message applied.
* bpo-31234: test_threaded_import: fix test_side_effect_import() (#3189)Victor Stinner2017-08-221-1/+3
| | | | * Don't leak the module into sys.modules * Avoid dangling thread
* bpo-31234: test_httpservers joins the server thread (#3188)Victor Stinner2017-08-221-0/+1
|
* bpo-23835: Enforce that configparser defaults are strings (#2558)James Tocknell2017-08-211-0/+9
| | | | * Enforce that configparser defaults are strings * Update test_configparser.py
* Add test_subprocess.test_nonexisting_with_pipes() (#3133)Victor Stinner2017-08-211-4/+47
| | | | bpo-30121: Test the Popen failure when Popen was created with pipes. Create also NONEXISTING_CMD variable in test_subprocess.py.
* bpo-31249: test_concurrent_futures checks dangling threads (#3167)Victor Stinner2017-08-211-12/+20
| | | | | Add a BaseTestCase class to test_concurrent_futures to check for dangling threads and processes on all tests, not only tests using ExecutorMixin.