summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↵Carl Meyer2018-06-163-11/+121
| | | | | | | | | | | | | | | (GH-6834) In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.
* bpo-33873: regrtest: Add warning on -R 1:3 (GH-7736)Pablo Galindo2018-06-161-0/+7
| | | regrtest: Add warning when using less than 3 warmup runs like -R 1:3.
* Revert "bpo-32962: Fix test_gdb failure in debug build with -mcet ↵Victor Stinner2018-06-151-9/+2
| | | | | -fcf-protection -O0 (GH-6754)" (#7723) This reverts commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287.
* bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection ↵Marcel Plch2018-06-151-2/+9
| | | | | | | | | -O0 (#6754) When Python is built with the intel control-flow protection flags, -mcet -fcf-protection, gdb is not able to read the stack without actually jumping inside the function. This means an extra 'next' command is required to make the $pc (program counter) enter the function and make the stack of the function exposed to gdb.
* bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958)Wonsup Yoon2018-06-151-0/+13
| | | | | Hangul composition check boundaries are wrong for the second character ([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3) instead of [0x11A7, 0x11C3]).
* bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring. (GH-7682)Serhiy Storchaka2018-06-151-0/+31
|
* bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)Victor Stinner2018-06-143-10/+44
| | | | | * Enhance also format_duration(): work on integers and rounds towards +infinity (math.ceil). * Write unit tests on format_duration()
* bpo-19382: Adding test cases for module tabnanny (GH-851)Jaysinh Shukla2018-06-142-1/+344
| | | Testing strategy: whitebox.
* bpo-33615: Re-enable subinterpreter tests. (#7552)Eric Snow2018-06-131-5/+6
| | | All the subinterpreter tests were disabled in gh-7513. This commit re-enables them, but leaves one bad test disabled. The test is partly causing problems because it makes assumptions about the availability of a high-level interpreters module (see PEP 554). So I'm disabling the test until such a high-level module is available.
* bpo-33671: efficient zero-copy for shutil.copy* functions (Linux, OSX and ↵Giampaolo Rodola2018-06-121-2/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Win) (#7160) * have shutil.copyfileobj use sendfile() if possible * refactoring: use ctx manager * add test with non-regular file obj * emulate case where file size can't be determined * reference _copyfileobj_sendfile directly * add test for offset() at certain position * add test for empty file * add test for non regular file dst * small refactoring * leave copyfileobj() alone in order to not introduce any incompatibility * minor refactoring * remove old test * update docstring * update docstring; rename exception class * detect platforms which only support file to socket zero copy * don't run test on platforms where file-to-file zero copy is not supported * use tempfiles * reset verbosity * add test for smaller chunks * add big file size test * add comment * update doc * update whatsnew doc * update doc * catch Exception * remove unused import * add test case for error on second sendfile() call * turn docstring into comment * add one more test * update comment * add Misc/NEWS entry * get rid of COPY_BUFSIZE; it belongs to another PR * update doc * expose posix._fcopyfile() for OSX * merge from linux branch * merge from linux branch * expose fcopyfile * arg clinic for the win implementation * convert path type to path_t * expose CopyFileW * fix windows tests * release GIL * minor refactoring * update doc * update comment * update docstrings * rename functions * rename test classes * update doc * update doc * update docstrings and comments * avoid do import nt|posix modules if unnecessary * set nt|posix modules to None if not available * micro speedup * update description * add doc note * use better wording in doc * rename function using 'fastcopy' prefix instead of 'zerocopy' * use :ref: in rst doc * change wording in doc * add test to make sure sendfile() doesn't get called aymore in case it doesn't support file to file copies * move CopyFileW in _winapi and actually expose CopyFileExW instead * fix line endings * add tests for mode bits * add docstring * remove test file mode class; let's keep it for later when Istart addressing OSX fcopyfile() specific copies * update doc to reflect new changes * update doc * adjust tests on win * fix argument clinic error * update doc * OSX: expose copyfile(3) instead of fcopyfile(3); also expose flags arg to python * osx / copyfile: use path_t instead of char * do not set dst name in the OSError exception in order to remain consistent with platforms which cannot do that (e.g. linux) * add same file test * add test for same file * have osx copyfile() pre-emptively check if src and dst are the same, otherwise it will return immedialtey and src file content gets deleted * turn PermissionError into appropriate SameFileError * expose ERROR_SHARING_VIOLATION in order to raise more appropriate SameFileError * honour follow_symlinks arg when using CopyFileEx * update Misc/NEWS * expose CreateDirectoryEx mock * change C type * CreateDirectoryExW actual implementation * provide specific makedirs() implementation for win * fix typo * skeleton for SetNamedSecurityInfo * get security info for src path * finally set security attrs * add unit tests * mimick os.makedirs() behavior and raise if dst dir exists * set 2 paths for OSError object * set 2 paths for OSError object * expand windows test * in case of exception on os.sendfile() set filename and filename2 exception attributes * set 2 filenames (src, dst) for OSError in case copyfile() fails on OSX * update doc * do not use CreateDirectoryEx() in copytree() if source dir is a symlink (breaks test_copytree_symlink_dir); instead just create a plain dir and remain consistent with POSIX implementation * use bytearray() and readinto() * use memoryview() with bytearray() * refactoring + introduce a new _fastcopy_binfileobj() fun * remove CopyFileEx and other C wrappers * remove code related to CopyFileEx * Recognize binary files in copyfileobj() ...and use fastest _fastcopy_binfileobj() when possible * set 1MB copy bufsize on win; also add a global _COPY_BUFSIZE variable * use ctx manager for memoryview() * update doc * remove outdated doc * remove last CopyFileEx remnants * OSX - use fcopyfile(3) instead of copyfile(3) ...as an extra safety measure: in case src/dst are "exotic" files (non regular or living on a network fs etc.) we better fail on open() instead of copyfile(3) as we're not quite sure what's gonna happen in that case. * update doc
* bpo-32108: Don't clear configparser values if key is assigned to itself ↵Cheryl Sabella2018-06-121-0/+6
| | | | (GH-7588)
* bpo-27397: Make email module properly handle invalid-length base64 strings ↵Tal Einat2018-06-123-0/+32
| | | | | | | (#7583) When attempting to base64-decode a payload of invalid length (1 mod 4), properly recognize and handle it. The given data will be returned as-is, i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
* bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650)Ned Deily2018-06-121-3/+1
|
* bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530)Christian Heimes2018-06-111-1/+3
| | | | | | | | | The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were misleading and partly wrong. It fails to explain that OpenSSL behaves differently in client and server mode. Also OpenSSL does validate the cert chain everytime. With SSL_VERIFY_NONE a validation error is not fatal in client mode and does not request a client cert in server mode. Also discourage people from using CERT_OPTIONAL in client mode.
* bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)Matthias Bussonnier2018-06-111-4/+6
|
* bpo-33812: Corrected astimezone for naive datetimes. (GH-7578)Alexander Belopolsky2018-06-101-9/+16
| | | | | | | | | | | | | | | | | | | | A datetime object d is aware if d.tzinfo is not None and d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None, or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None, d is naive. This commit ensures that instances with non-None d.tzinfo, but d.tzinfo.utcoffset(d) returning None are treated as naive. In addition, C acceleration code will raise TypeError if d.tzinfo.utcoffset(d) returns an object with the type other than timedelta. * Updated the documentation. Assume that the term "naive" is defined elsewhere and remove the not entirely correct clarification. Thanks, Tim.
* bpo-33770: improve base64 exception message for encoded inputs of invalid ↵Tal Einat2018-06-101-0/+28
| | | | length (#7416)
* Datetime test coverage (#7544)Alexander Belopolsky2018-06-081-3/+9
| | | | | | | | | | | | | | * Added a test case for strftime("%z"). The added test checks a case with UTC offest expressed in an integer number of seconds. * Added a test comparing naive and aware datetimes. Check that a greater than comparison of a naive datetime instance with an aware one raises a TypeError. * Test datetime in fold or in gap comparison both ways.
* bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622)Thomas Kluyver2018-06-081-75/+9
| | | More consistent with how other parts of Python find the filename (e.g. tracebacks and pdb).
* bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)Łukasz Langa2018-06-081-0/+43
| | | This solves a regression in logging config due to changes in BPO-23835.
* bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)wim glenn2018-06-081-9/+33
| | | | | | - bugfix and test for fragile metavar handling in argparse (see bpo-24089, bpo-14046, bpo-25058, bpo-11874) - also fixes some incorrect tests that did not make 1-element tuples correctly
* bpo-33694: Fix typo in helper function name (GH-7522)Victor Stinner2018-06-081-6/+6
| | | | | | _feed_data_to_bufferred_proto() renamed to _feed_data_to_buffered_proto() ("bufferred" => "buffered"). Typo spotted by Nathaniel J. Smith.
* bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)Victor Stinner2018-06-082-7/+44
| | | | | | If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE then SUCCESS") to show that some failing tests have been re-run. Add also test_regrtest.test_rerun_fail() test.
* bpo-33792: Add selector and proactor windows policies (GH-7487)Yury Selivanov2018-06-081-0/+31
|
* bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() ↵Yury Selivanov2018-06-082-0/+78
| | | | (GH-7467)
* bpo-33615: Skip test__xxsubinterpreters (GH-7503)Victor Stinner2018-06-081-0/+2
| | | | | The test does crash on multiple CIs causing many troubles. For example, the test prevents to get results of the two Refleak 3.x buildbots.
* bpo-33694: Fix race condition in asyncio proactor (GH-7498)Victor Stinner2018-06-072-6/+11
| | | | | | | | | | | | | | | | The cancellation of an overlapped WSARecv() has a race condition which causes data loss because of the current implementation of proactor in asyncio. No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport to work around the race condition. Remove the optimized recv_into() implementation to get simple implementation of pause_reading() using the single _pending_data attribute. Move _feed_data_to_bufferred_proto() to protocols.py. Remove set_protocol() method which became useless.
* bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488)Eric V. Smith2018-06-071-85/+120
|
* bpo-33274: Compliance with DOM L1: return removed attribute (#7465)arikrupnik2018-06-071-1/+1
| | | | | | * bpo-33274: Compliance with DOM L1: return removed attribute * Update 2018-06-06-22-01-33.bpo-33274.teYqv8.rst
* update to Unicode 11.0.0 (closes bpo-33778) (GH-7439)Benjamin Peterson2018-06-071-2/+2
| | | Also, standardize indentation of generated tables.
* bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462)Victor Stinner2018-06-061-1/+5
| | | | | | | Fix "<CoroWrapper ...> was never yielded from" warning in PyTask_PyFuture_Tests.test_error_in_call_soon() of test_asyncio.test_tasks. Close manually the coroutine on error.
* bpo-33789, test_asyncio: Hide PendingDeprecationWarning (GH-7461)Victor Stinner2018-06-061-1/+2
| | | Hide PendingDeprecationWarning in test__register_task_3().
* bpo-33789: test_asyncio: Fix ResourceWarning (GH-7460)Victor Stinner2018-06-062-2/+12
| | | | | * Close sockets and streams to fix ResourceWarning warnings * Catch also OSError to hide a traceback on an expected handshake error
* bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)Victor Stinner2018-06-062-8/+21
| | | | | | | | | Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure.
* test.support.SaveSignals: fix typo (GH-7448)Victor Stinner2018-06-061-1/+1
| | | an => and
* bpo-31044, test_posix: Reenable makedev() tests on FreeBSD (#7449)Victor Stinner2018-06-061-5/+0
| | | | | | The bug has been fixed 10 months ago: * https://svnweb.freebsd.org/base?view=revision&revision=321920 * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221048
* bpo-33504: Migrate configparser from OrderedDict to dict. (#6819)John Reese2018-06-051-1/+1
| | | | | | With 3.7+, dictionary are ordered by design. Configparser still uses collections.OrderedDict, which is unnecessary. This updates the module to use the standard dict implementation by default, and changes the docs and tests to match.
* Improve the subprocess restore_signals=True test. (GH-7414)Gregory P. Smith2018-06-051-6/+22
| | | It wasn't testing functionality. Now it is (on Linux anyways).
* bpo-12486: Document tokenize.generate_tokens() as public API (#6957)Thomas Kluyver2018-06-051-2/+15
| | | | | | | | | | | | * Document tokenize.generate_tokens() * Add news file * Add test for generate_tokens * Document behaviour around ENCODING token * Add generate_tokens to __all__
* bpo-33751: Fix test_file. (GH-7378)Serhiy Storchaka2018-06-051-84/+78
| | | | | | testModeStrings and testTruncateOnWindows were depended on a file leaked in other tests. Also improve cleaning up after tests.
* bpo-33755: Fix importlib.resources isolation tests (#7412)Barry Warsaw2018-06-052-1/+9
|
* bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424)Vinay Sajip2018-06-051-0/+31
|
* bpo-33752: Fix a file leak in test_dbm. (GH-7376)Serhiy Storchaka2018-06-051-4/+2
| | | | With addCleanup() f.close() was executed after tearDown().
* bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)Zackery Spytz2018-06-051-0/+7
| | | | Raise TypeError instead of SystemError for unsupported operations.
* bpo-33753: Refactor creating temporary files in test_fileinput. (GH-7377)Serhiy Storchaka2018-06-051-148/+101
|
* bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)Steve Dower2018-06-041-1/+4
|
* bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)Yury Selivanov2018-06-042-31/+214
| | | | | | | * Fix AttributeError (not all SSL exceptions have 'errno' attribute) * Increase default handshake timeout from 10 to 60 seconds * Make sure start_tls can be cancelled correctly * Make sure any error in SSLProtocol gets propagated (instead of just being logged)
* bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)Victor Stinner2018-06-041-0/+2
| | | | Fix test_warnings.test_module_globals() when python3 is run with -Werror.
* bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362)Serhiy Storchaka2018-06-041-1/+3
| | | It depended on a global variable set by other tests.
* bpo-33760: Fix file leaks in test_io. (GH-7361)Serhiy Storchaka2018-06-041-0/+4
|