summaryrefslogtreecommitdiff
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45876: Correctly rounded stdev() and pstdev() for the Decimal case ↵Raymond Hettinger2021-11-301-9/+46
| | | | (GH-29828)
* bpo-30533:Add function inspect.getmembers_static that does not call ↵Weipeng Hong2021-11-301-0/+17
| | | | | | | | | | | | | | | | | | | | | properties or dynamic properties. (#20911) * Add function inspect.getmembers_static that does not call properties or dynamic properties. * update _getmembers args * Update Misc/NEWS.d/next/Library/2020-06-16-18-00-56.bpo-30533.StL57t.rst Co-authored-by: Itamar Ostricher <itamarost@gmail.com> * Update Lib/inspect.py Co-authored-by: Itamar Ostricher <itamarost@gmail.com> * Removes the copy pasted doc string Co-authored-by: Itamar Ostricher <itamarost@gmail.com> Co-authored-by: Dino Viehland <dinoviehland@gmail.com>
* no-issue: remove unused import from test_graphlib.py (GH-29853)Adrian Garcia Badaracco2021-11-301-2/+1
|
* bpo-45653: fix test_embed on windows (GH-29814)Kumar Aditya2021-11-291-1/+1
|
* bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)Gideon2021-11-291-0/+11
| | | Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591)Erlend Egeberg Aasland2021-11-292-29/+34
|
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-292-7/+6
|
* bpo-37658: Actually return result in race condition (GH-29202)Sam Bull2021-11-291-30/+8
|
* bpo-19460: Add test for MIMENonMultipart (GH-29817)1809092021-11-281-0/+14
|
* bpo-45614: Fix traceback display for exceptions with invalid module name ↵Irit Katriel2021-11-271-0/+11
| | | | (GH-29726)
* bpo-45876: Improve accuracy for stdev() and pstdev() in statistics (GH-29736)Raymond Hettinger2021-11-261-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Inlined code from variance functions * Added helper functions for the float square root of a fraction * Call helper functions * Add blurb * Fix over-specified test * Add a test for the _sqrt_frac() helper function * Increase the tested range * Add type hints to the internal function. * Fix test for correct rounding * Simplify ⌊√(n/m)⌋ calculation Co-authored-by: Mark Dickinson <dickinsm@gmail.com> * Add comment and beef-up tests * Test for zero denominator * Add algorithmic references * Add test for the _isqrt_frac_rto() helper function. * Compute the 109 instead of hard-wiring it * Stronger test for _isqrt_frac_rto() * Bigger range * Bigger range * Replace float() call with int/int division to be parallel with the other code path. * Factor out division. Update proof link. Remove internal type declaration Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if ↵Pablo Galindo Salgado2021-11-242-3/+3
| | | | inside parentheses (GH-29757)
* bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750)Pablo Galindo Salgado2021-11-241-8/+8
|
* bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)Jason R. Coombs2021-11-246-81/+144
| | | | | | | | | | | * bpo-45514: Apply changes from importlib_resources@a3ef4128c6 * Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs. * Apply changes from importlib_resources@329ae9d5f2c. * Indicate importlib.resources as a module. Co-authored-by: Filipe Laíns <lains@riseup.net>
* bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… ↵Miro Hrončok2021-11-231-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-29384) Consider the following directory structure: . └── PATH1 └── namespace └── sub1 └── __init__.py And both PATH1 and PATH2 in sys path: $ PYTHONPATH=PATH1:PATH2 python3.11 >>> import namespace >>> import namespace.sub1 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> ... While this interpreter still runs, PATH2/namespace/sub2 is created: . ├── PATH1 │ └── namespace │ └── sub1 │ └── __init__.py └── PATH2 └── namespace └── sub2 └── __init__.py The newly created module cannot be imported: >>> ... >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'namespace.sub2' Calling importlib.invalidate_caches() now newly allows to import it: >>> import importlib >>> importlib.invalidate_caches() >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace']) This was not previously possible.
* bpo-45783: Preserve file moves and deletions in the tests for the freeze ↵Eric Snow2021-11-231-4/+5
| | | | | | tool. (GH-29527) Use shutil.copytree rather than Git, which might be missing (or configured differently) when testing Python built from a source release.
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-232-53/+59
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45871: Refactor except matcher validation into a separate function so ↵Irit Katriel2021-11-221-0/+15
| | | | that it can be reused. Add missing unit test. (GH-29711)
* bpo-45859: Mark test_field_descriptor in test_collections as CPython-only ↵Carl Friedrich Bolz-Tereick2021-11-221-0/+1
| | | | (GH-29691)
* bpo-45813: Make sure that frame->generator is NULLed when generator is ↵Mark Shannon2021-11-221-0/+7
| | | | deallocated. (GH-29700)
* bpo-44649: Fix dataclasses(slots=True) with a field with a default, but ↵Eric V. Smith2021-11-221-0/+22
| | | | | init=False (GH-29692) Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
* bpo-45766: Add direct proportion option to linear_regression(). (#29490)Raymond Hettinger2021-11-211-0/+6
| | | | | | | | | | | | | | | | | * bpo-45766: Add direct proportion option to linear_regression(). * Update 2021-11-09-09-18-06.bpo-45766.dvbcMf.rst * Use ellipsis to avoid round-off issues. * Update Misc/NEWS.d/next/Library/2021-11-09-09-18-06.bpo-45766.dvbcMf.rst Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> * Update signature in main docs * Fix missing comma Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* Added kw_only parameter to make_dataclasses. (GH-29679)Eric V. Smith2021-11-201-0/+11
|
* bpo-44733: Add max_tasks_per_child to ProcessPoolExecutor (GH-27373)Logan Jones2021-11-201-1/+30
| | | Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-45811: Improve error message when source code contains invisible control ↵Pablo Galindo Salgado2021-11-201-0/+3
| | | | characters (GH-29654)
* bpo-45450: Improve syntax error for parenthesized arguments (GH-28906)Pablo Galindo Salgado2021-11-201-0/+38
|
* bpo-45852: Fix the Counter/iter test for statistics.mode() (GH-29667)Raymond Hettinger2021-11-201-4/+7
| | | Suggested by Stefan Pochmann.
* bpo-45848: Allow the parser to get error lines from encoded files (GH-29646)Pablo Galindo Salgado2021-11-201-0/+13
|
* bpo-45506: Fix test_embed expecting to not find stdlib in source tree build ↵Steve Dower2021-11-201-6/+11
| | | | when stdlib has been installed. (GH-29649)
* bpo-45727: Make the syntax error for missing comma more consistent (GH-29427)Pablo Galindo Salgado2021-11-191-0/+1
|
* bpo-45507: EOFErrors should be thrown for truncated gzip members (GH-29029)Ruben Vorderman2021-11-191-0/+8
|
* bpo-45709: Fix tracing when exception is handled. (GH-29638)Mark Shannon2021-11-191-0/+32
|
* bpo-45609: Specialize STORE_SUBSCR (GH-29242)Dennis Sweeney2021-11-191-0/+8
| | | | | * Specialize STORE_SUBSCR for list[int], and dict[object] * Adds _PyDict_SetItem_Take2 which consumes references to the key and values.
* bpo-45835: Fix race condition in test_queue (#29601)Sam Gross2021-11-181-11/+11
| | | | | | | | | | Some of the tests in test_queue had a race condition in which a non-sentinel value could be enqueued after the final sentinel value leading to not all the inputs being processed (and test failures). This changes feed() to enqueue a sentinel once the inputs are exhausted, which guarantees that the final queued object is a sentinel. This requires the number of feeder threads to match the number of consumer threads, but that's already the case in the relevant tests.
* bpo-45826: Fix a crash in suggestions.c by checking for `traceback is None` ↵Dennis Sweeney2021-11-181-0/+31
| | | | (GH-29590)
* bpo-42540: reallocation of id_mutex should not force default allocator ↵Sam Gross2021-11-171-0/+16
| | | | | | | (GH-29564) Unlike the other locks reinitialized by _PyRuntimeState_ReInitThreads, the "interpreters.main->id_mutex" is not freed by _PyRuntimeState_Fini and should not force the default raw allocator.
* bpo-45512: Extend `sqlite3` test suite regarding isolation levels (GH-29576)Erlend Egeberg Aasland2021-11-172-3/+124
|
* bpo-28806: Continue work: improve the netrc library (GH-26330)Emmanuel Arias2021-11-171-81/+224
| | | | | | | | | Continue with the improvement of the library netrc Original work and report Xiang Zhang <angwerzx@126.com> * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are ↵Pablo Galindo Salgado2021-11-161-0/+8
| | | | not provided (GH-29582)
* bpo-45126: Harden `sqlite3` connection initialisation (GH-28227)Erlend Egeberg Aasland2021-11-161-0/+38
|
* bpo-45292: Use raw strings for regex in tests (GH-29545)Irit Katriel2021-11-161-3/+3
|
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-1614-2197/+1719
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-45512: Raise exception if sqlite3.Connection.__init__ is called with bad ↵Erlend Egeberg Aasland2021-11-151-2/+16
| | | | | | | | | | | | | | | isolation level (#29561) * bpo-45512: Raise sqlite3.Connection.__init__ is called with bad isolation level * Also explicitly test allowed isolation levels * Use subTest for better error messages if something goes wrong * Update Lib/test/test_sqlite3/test_dbapi.py Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-45738: Fix computation of error location for invalid continuation (GH-29550)Pablo Galindo Salgado2021-11-141-1/+7
| | | characters in the parser
* bpo-45745: Remove regrtest --findleaks options (GH-29514)Victor Stinner2021-11-124-17/+4
| | | | | Remove the --findleaks command line option of regrtest: use the --fail-env-changed option instead. Since Python 3.7, it was a deprecated alias to the --fail-env-changed option.
* bpo-45235: Revert an argparse bugfix that caused a regression (GH-29525)Raymond Hettinger2021-11-111-6/+0
| | | | | * Revert "bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28443)" This reverts commit a18d52269ab6071a605d6c72f6af585a4c533ca4.
* bpo-45773: Stop "optimizing" certain jump patterns (GH-29505)Brandt Bucher2021-11-111-0/+7
|
* bpo-45636: Merge all numeric operators (GH-29482)Brandt Bucher2021-11-103-28/+30
|
* bpo-45754: Use correct SQLite limit when checking statement length (GH-29489)Erlend Egeberg Aasland2021-11-102-7/+7
|
* bpo-45711: remove unnecessary DUP_TOP and POP in exception handling (GH-29495)Irit Katriel2021-11-101-89/+87
|