summaryrefslogtreecommitdiff
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45410: libregrtest -jN writes stderr into stdout (GH-28819)masterVictor Stinner2021-10-081-22/+18
| | | | | | When libregrtest spawns a worker process, stderr is now written into stdout to keep messages order. Use a single pipe for stdout and stderr, rather than two pipes. Previously, messages were out of order which made analysis of buildbot logs harder
* bpo-45408: Don't override previous tokenizer errors in the second parser ↵Pablo Galindo Salgado2021-10-072-1/+9
| | | | pass (GH-28812)
* bpo-45337: Use the realpath of the new executable when creating a venv on ↵Steve Dower2021-10-071-2/+8
| | | | Windows (GH-28663)
* bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)Victor Stinner2021-10-071-2/+2
| | | | Fix test_sys.test_stdlib_dir() when Python is built outside the source tree: compare normalized paths.
* bpo-45400: Fix suggestion test of test_exceptions (GH-28783)Victor Stinner2021-10-071-1/+1
| | | | | Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals() of test_exceptions if a directory name contains "a1" (like "Python-3.11.0a1"): use a stricter regular expression.
* bpo-35970: Add help flag to base64 module (GH-28774)Ammar Askar2021-10-061-0/+10
| | | This continues off rkuska's work from https://github.com/python/cpython/pull/11789 seeing as the patch wasn't updated to add tests.
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-0634-44/+44
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40321: Add missing test, slightly expand documentation (GH-28760)Łukasz Langa2021-10-061-3/+3
|
* bpo-40116: Add insertion order bit-vector to dict values to allow dicts to ↵Mark Shannon2021-10-061-36/+1
| | | | share keys more freely. (GH-28520)
* Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)Mark Shannon2021-10-061-2/+2
|
* bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)Eric Snow2021-10-052-18/+48
| | | | | | | In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.) Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen(). https://bugs.python.org/issue45020
* Rearrage the finder tests. (gh-28740)Eric Snow2021-10-051-30/+56
| | | | | This makes the tests a bit cleaner and makes adding more tests a little simpler. https://bugs.python.org/issue45324
* bpo-45324: Capture data in FrozenImporter.find_spec() to use in ↵Eric Snow2021-10-052-23/+60
| | | | | | | | | | | exec_module(). (gh-28633) Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec(). Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it. We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter. We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient. Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.) https://bugs.python.org/issue45324
* bpo-44050: Extension modules can share state when they don't support ↵Hai Shi2021-10-051-0/+31
| | | | | sub-interpreters. (GH-27794) Automerge-Triggered-By: GH:encukou
* bpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)Jeremy Kloth2021-10-051-4/+7
|
* bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)John Belmonte2021-10-032-0/+69
| | | | | | | | | * bpo-44594: fix (Async)ExitStack handling of __context__ Make enter_context(foo()) / enter_async_context(foo()) equivalent to `[async] with foo()` regarding __context__ when an exception is raised. Previously exceptions would be caught and re-raised with the wrong context when explicitly overriding __context__ with None.
* Remove trailing spaces. (GH-28706)Serhiy Storchaka2021-10-032-3/+3
|
* bpo-45346: Keep docs consistent regarding true and false values (GH-28697)Raymond Hettinger2021-10-021-1/+1
|
* bpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294)Nikita Sobolev2021-10-011-31/+104
|
* Revert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" ↵Serhiy Storchaka2021-10-011-47/+45
| | | | | (GH-28650)" (GH-28667) This reverts commit b07fddd527efe67174ce6b0fdbe8dac390b16e4e.
* bpo-45310: Fix parrallel shared memory tests (GH-28661)Serhiy Storchaka2021-10-011-16/+24
| | | | | | Add a PID to names of POSIX shared memory objects to allow running multiprocessing tests (test_multiprocessing_fork, test_multiprocessing_spawn, etc) in parallel.
* bpo-45020: Add more test cases for frozen modules. (gh-28664)Eric Snow2021-09-302-13/+94
| | | | | I've added a number of test-only modules. Some of those cases are covered by the recently frozen stdlib modules (and some will be once we add encodings back in). However, I figured we'd play it safe by having a set of modules guaranteed to be there during tests. https://bugs.python.org/issue45020
* bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)Serhiy Storchaka2021-09-303-52/+30
| | | | | | | | | | | | * Work correctly if an additional fresh module imports other additional fresh module which imports a blocked module. * Raises ImportError if the specified module cannot be imported while all additional fresh modules are successfully imported. * Support blocking packages. * Always restore the import state of fresh and blocked modules and their submodules. * Fix test_decimal and test_xml_etree which depended on an undesired side effect of import_fresh_module().
* Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)Pablo Galindo Salgado2021-09-301-45/+47
| | | This reverts commit d441437ee71ae174c008c23308b749b91020ba77.
* bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)Victor Stinner2021-09-301-1/+48
| | | | | | | | | | | | | | | Add the _PyTime_AsTimespec_clamp() function: similar to _PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise an exception. PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to remove the Py_UNREACHABLE() code path. * Add _PyTime_AsTime_t() function. * Add PY_TIME_T_MIN and PY_TIME_T_MAX constants. * Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp(). * Add pytime_divide_round_up() function. * Fix integer overflow in pytime_divide(). * Add pytime_divmod() function.
* bpo-45229: Make datetime tests discoverable (GH-28615)Serhiy Storchaka2021-09-291-47/+45
|
* bpo-24391: Better reprs for threading objects. (GH-20534)Serhiy Storchaka2021-09-291-0/+36
| | | | Add reprs for Semaphore, BoundedSemaphore, Event, and Barrier.
* bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766)Jack DeVries2021-09-291-0/+14
| | | | | | | * during tarfile parsing, a zlib error indicates invalid data * tarfile.open now raises a descriptive exception from the zlib error * this makes it clear to the user that they may be trying to open a corrupted tar file
* bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540)Nikita Sobolev2021-09-281-0/+9
|
* bpo-45211: Remember the stdlib dir during startup. (gh-28586)Eric Snow2021-09-282-0/+27
| | | | | During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir. https://bugs.python.org/issue45211
* bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)Pablo Galindo Salgado2021-09-281-6/+12
|
* bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)Victor Stinner2021-09-271-0/+33
| | | | | Fix the threading._shutdown() function when the threading module was imported first from a thread different than the main thread: no longer log an error at Python exit.
* bpo-45249: Ensure the traceback module prints correctly syntax errors with ↵Pablo Galindo Salgado2021-09-271-0/+13
| | | | ranges (GH-28575)
* bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)Eric Snow2021-09-271-1/+1
| | | | | | | | | | | | This accomplishes 2 things: * consolidates some common code between getpath.c and getpathp.c * makes the helpers available to code in other files FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx(). Note that this change is mostly moving code around. No behavior is meant to change. https://bugs.python.org/issue45211
* bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator ↵Pablo Galindo Salgado2021-09-271-1/+12
| | | | expression in function calls (GH-28576)
* bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559)Nikita Sobolev2021-09-261-0/+13
| | | Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279)Nikita Sobolev2021-09-253-1/+34
| | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44019: Implement operator.call(). (GH-27888)Antony Lee2021-09-241-0/+12
| | | | | | Having `operator.call(obj, arg)` mean `type(obj).__call__(obj, arg)` is consistent with the other dunder operators. The semantics with `*args, **kwargs` then follow naturally from the single-arg semantics.
* bpo-20524: adds better error message for `.format()` (GH-28310)Nikita Sobolev2021-09-241-0/+28
| | | It now lists the bad format_spec and the type of the object.
* bpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception ↵Daniel Hillier2021-09-231-4/+17
| | | | (GH-18031)
* bpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators ↵Jason Fried2021-09-231-0/+76
| | | | (GH-16667)
* bpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343)Alexander Böhn2021-09-221-0/+7
|
* [codemod] Fix non-matching bracket pairs (GH-28473)Mohamad Mansour2021-09-224-5/+5
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [tests] Add missing assert against expected tracebacks in test_exceptions.py ↵andrei kulakov2021-09-221-0/+1
| | | | (GH-28484)
* bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in ↵andrei kulakov2021-09-211-0/+40
| | | | | shutil.copyfile() (GH-28421) This was a regression from fixing BPO-43219.
* bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing ↵Nikita Sobolev2021-09-211-0/+7
| | | | (GH-28377)
* bpo-45021: Fix a hang in forked children (GH-28007)nullptr2021-09-201-0/+14
| | | _global_shutdown_lock should be reinitialized in forked children
* bpo-45229: Make pickle tests discoverable (GH-28467)Serhiy Storchaka2021-09-203-47/+36
|
* bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)Rémi Lapeyre2021-09-201-0/+8
| | | | Co-authored-by: Tal Einat <taleinat@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)Serhiy Storchaka2021-09-2017-188/+122
| | | Alo use load_tests() for adding tests.