summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-93627: Align Python implementation of pickle with C implementation of ↵Pieter Eendebak2023-09-103-10/+72
| | | | | pickle (GH-103035) If a method like __reduce_ex_ or __reduce__ is set to None, a TypeError is raised.
* gh-109174: Add support of SimpleNamespace in copy.replace() (GH-109175)Serhiy Storchaka2023-09-104-0/+58
|
* gh-109162: libregrtest: add Logger class (#109212)Victor Stinner2023-09-104-99/+123
| | | | | | | | | | | | | | | | | | | | * Add Logger class in a new logger.py file. * Move Regrtest attributes to Logger: * start_time * test_count_text * test_count_width * win_load_tracker * Move Regrtest method to Logger: * log() * getloadavg(): rename to get_load_avg() * set_tests() * Add methods to the Logger class: * start_load_tracker() * stop_load_tracker()
* gh-109162: libregrtest: add TestResults class (#109208)Victor Stinner2023-09-103-274/+306
| | | | | | | | | | | | | | | | | | | | * Add TestResults class. * Move Regrtest methods to TestResults: * accumulate_result(): now takes a RunTests parameter * get_executed() * no_tests_run() * Add methods to TestResults: * add_junit() * display_result() * display_summary() * need_rerun() * prepare_rerun() * write_junit() * Rename 'need_rerun' attribute to 'bad_results'. * Rename 'total_stats' attribute to 'stats'.
* gh-109162: Refactor libregrtest.Regrtest (#109206)Victor Stinner2023-09-105-115/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add type hint types: TestName, StrPath, StrJSON. * Add attributes to Regrtest: * cmdline_args * coverage * coverage_dir * fail_rerun * next_single_filename * print_slowest * tmp_dir * want_rerun * want_run_leaks * Remove Regrtest.ns attribute. * Rename Regrtest methods: * cleanup() => cleanup_temp_dir() * create_temp_dir() => make_temp_dir() * set_temp_dir() => select_temp_dir() * Convert Regrtest methods to static methods: * cleanup_temp_dir() * display_header() * fix_umask() * get_rerun_match_tests() * list_tests() * make_temp_dir() * select_temp_dir() * Remove display_sanitizers() method: move code into display_header(). * Rename 'test_cwd' variable to 'work_dir'.
* gh-109162: Refactor libregrtest.runtest_mp (#109205)Victor Stinner2023-09-104-56/+57
| | | | | | | | | | | | | | * Add attributes to Regrtest and RunTests: * fail_env_changed * num_workers * Rename MultiprocessTestRunner to RunWorkers. Add num_workers parameters to RunWorkers constructor. Remove RunWorkers.ns attribute. * Rename TestWorkerProcess to WorkerThread. * get_running() now returns a string like: "running (...): ...". * Regrtest.action_run_tests() now selects the number of worker processes, instead of the command line parser.
* gh-109162: libregrtest: remove WorkerJob class (#109204)Victor Stinner2023-09-097-88/+126
| | | | | | | | | | | | | | | * Add attributes to Regrtest and RunTests: * gc_threshold * memory_limit * python_cmd * use_resources * Remove WorkerJob class. Add as_json() and from_json() methods to RunTests. A worker process now only uses RunTests for all parameters. * Add tests on support.set_memlimit() in test_support. Create _parse_memlimit() and also adds tests on it. * Remove 'ns' parameter from runtest.py.
* gh-109162: libregrtest: fix _decode_worker_job() (#109202)Victor Stinner2023-09-093-5/+21
| | | | | Decode also HuntRefleak() object inside the RunTests object. Add an unit test on huntrleaks with multiprocessing (-R -jN).
* Improve the sieve() recipe in the itertools docs (gh-109199)Raymond Hettinger2023-09-091-4/+7
| | | Lazier sieve
* Fix an ironic typo in a code comment. (gh-109186)Raymond Hettinger2023-09-091-1/+1
|
* gh-109162: Refactor libregrtest.RunTests (#109177)Victor Stinner2023-09-095-60/+88
| | | | | | | | | | | | * Rename dash_R() runtest_refleak(). The function now gets huntrleaks and quiet arguments, instead of 'ns' argument. * Add attributes to Regrtest and RunTests: * verbose * quiet * huntrleaks * test_dir * Add HuntRefleak class.
* gh-109050: Remove remaining tests for legacy Unicode C API (GH-109068)Serhiy Storchaka2023-09-096-197/+1
|
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function ↵Jelle Zijlstra2023-09-097-106/+189
| | | | (#109123)
* gh-109162: Refactor libregrtest.runtest (#109172)Victor Stinner2023-09-095-104/+134
| | | | | | | | | | | | | | | | | | | | | | * Rename runtest() to run_single_test(). * Pass runtests to run_single_test(). * Add type annotation to Regrtest attributes. Add missing attributes to Namespace. * Add attributes to Regrtest and RunTests: * fail_fast * ignore_tests * match_tests * output_on_failure * pgo * pgo_extended * timeout * Get pgo from 'runtests', rather than from 'ns'. * Remove WorkerJob.match_tests. * setup_support() now gets pgo_extended from runtests. * save_env(): change parameter order, pass test_name first. * Add setup_test_dir() function. * Pass runtests to setup_tests().
* gh-109052: Use the base opcode when comparing code objects (gh-109107)Tian Gao2023-09-093-6/+24
|
* gh-109162: Refactor libregrtest WorkerJob (#109171)Victor Stinner2023-09-095-41/+48
| | | | | | | | | | | | | | | * Rename --worker-args command line option to --worker-json. * Rename _parse_worker_args() to _parse_worker_json(). * WorkerJob: * Add runtests attribute * Remove test_name and rerun attribute * Rename run_test_in_subprocess() to create_worker_process(). * Rename run_tests_worker() to worker_process(). * create_worker_process() uses json.dump(): write directly JSON to stdout. * Convert MultiprocessResult to a frozen dataclass. * Rename RunTests.match_tests to RunTests.match_tests_dict.
* gh-109162: Refactor Regrtest.action_run_tests() (#109170)Victor Stinner2023-09-091-49/+49
| | | | | | | Refator Regrtest class: * Rename finalize() finalize_tests(). * Pass tracer to run_test() and finalize_tests(). Remove Regrtest.tracer. * run_test() does less things: move code to its caller.
* gh-108996: Skip broken test_msvcrt for now (#109169)Victor Stinner2023-09-081-0/+2
|
* gh-109162: Regrtest copies 'ns' attributes (#109168)Victor Stinner2023-09-083-48/+73
| | | | | | | | | | * Regrtest.__init__() now copies 'ns' namespace attributes to Regrtest attributes. Regrtest match_tests and ignore_tests attributes have type FilterTuple (tuple), instead of a list. * Add RunTests.copy(). Regrtest._rerun_failed_tests() now uses RunTests.copy(). * Replace Regrtest.all_tests (list) with Regrtest.first_runtests (RunTests). * Make random_seed maximum 10x larger (9 digits, instead of 8).
* gh-109162: Refactor Regrtest.main() (#109163)Victor Stinner2023-09-084-62/+64
| | | | | | | | | | | | | * main() now calls _parse_args() and pass 'ns' to Regrtest constructor. Remove kwargs argument from Regrtest.main(). * _parse_args() checks ns.huntrleaks. * set_temp_dir() is now responsible to call expanduser(). * Regrtest.main() sets self.tests earlier. * Add TestTuple and TestList types. * Rename MatchTests to FilterTuple and rename MatchTestsDict to FilterTestDict. * TestResult.get_rerun_match_tests() return type is now FilterTuple: return a tuple instead of a list. RunTests.tests type becomes TestTuple.
* gh-108996: add tests for msvcrt (#109004)AN Long2023-09-082-0/+112
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-109054: configure checks if libatomic is needed (#109101)Victor Stinner2023-09-083-2/+151
| | | | | | | | | | | | | | | | Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>. Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-108455: peg_generator: enable mypy's `--warn-unreachable` setting and ↵Alex Waygood2023-09-083-9/+13
| | | | `redundant-expr` error code (#109160)
* gh-91960: FreeBSD Cirrus CI runs configure separately (#109127)Victor Stinner2023-09-081-2/+5
| | | Run configure and make in separated steps to have more readable logs.
* gh-109114: Relax the check for invalid lambdas inside f-strings to avoid ↵Pablo Galindo Salgado2023-09-084-1125/+1073
| | | | false positives (#109121)
* Check the result of PySet_Contains() for error in Python/symtable.c (GH-109146)Serhiy Storchaka2023-09-081-15/+57
|
* GH-108614: Unbreak emscripten build (GH-109132)Mark Shannon2023-09-085-10/+11
|
* GH-109067: fix randomly failing `test_async_gen_asyncio_gc_aclose_09` test ↵Kumar Aditya2023-09-081-3/+5
| | | | | (#109142) Use `asyncio.sleep(0)` instead of short sleeps.
* gh-109136: Fix summarize_stats.py tool (#109137)Michael Droettboom2023-09-081-1/+1
|
* gh-106922: Fix error location for constructs with spaces and parentheses ↵Pablo Galindo Salgado2023-09-084-3/+68
| | | | (#108959)
* gh-109140: Rename duplicated tests in `test_binascii` (#109141)Hugo van Kemenade2023-09-081-1/+1
|
* gh-104690: thread_run() checks for tstate dangling pointer (#109056)Victor Stinner2023-09-084-20/+35
| | | | | | | | thread_run() of _threadmodule.c now calls _PyThreadState_CheckConsistency() to check if tstate is a dangling pointer when Python is built in debug mode. Rename ceval_gil.c is_tstate_valid() to _PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.
* GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)Victor Stinner2023-09-0817-39/+67
| | | | | | | Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
* GH-108716: Turn off deep-freezing of code objects. (GH-108722)Mark Shannon2023-09-0815-86/+50
|
* Update `CODEOWNERS` for `Tools/wasm/` (#109119)Brett Cannon2023-09-081-0/+3
|
* gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)Ethan Furman2023-09-083-4/+14
| | | | | | | add guard so that ``Enum('bar')`` raises a TypeError instead of creating a new enum class called `bar`. To create the new but empty class, use: huh = Enum('bar', names=())
* Use unittest test runner for doctests in test_statistics (GH-108921)Serhiy Storchaka2023-09-071-8/+1
|
* Add version directives to ast docs (#108788)Shantanu2023-09-071-4/+42
|
* gh-68403: Fix test_coverage in test_trace (GH-108910)Serhiy Storchaka2023-09-071-3/+8
| | | Its behavior no longer affected by test running options such as -m.
* gh-75743: Restore test_timeout.testConnectTimeout() (#109087)Ee Durbin2023-09-071-16/+10
| | | | This un-skips this test now that pythontest.net implements appropriate firewall rules for it.
* gh-103186: Make test_generated_cases less noisy by default (GH-109100)Serhiy Storchaka2023-09-071-5/+14
| | | Print additional details only when tests are run with -vv.
* gh-109094: remove unnecessary updates of frame->prev_instr in ↵Irit Katriel2023-09-072-6/+11
| | | | instrumentation functions (#109076)
* gh-107924: re-order os.sendfile() flag documentation (#107926)Christoph Anton Mitterer2023-09-071-19/+20
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-108732: include comprehension locals in frame.f_locals (#109026)Carl Meyer2023-09-073-4/+19
| | | | Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-102823: Document return type of floor division on floats (#102824)Mark Dickinson2023-09-072-3/+7
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-88943: Improve syntax error for non-ASCII character that follows a ↵Serhiy Storchaka2023-09-073-1/+8
| | | | | numerical literal (GH-109081) It now points on the invalid non-ASCII character, not on the valid numerical literal.
* gh-107544: Add docs about `json.dumps(..., default=)` (#108259)Nikita Sobolev2023-09-071-1/+12
|
* gh-71770: Add more details on behavior of configparser's default_section ↵Stanley2023-09-071-2/+4
| | | | | | (#31562) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* GH-108614: Add `RESUME_CHECK` instruction (GH-108630)Mark Shannon2023-09-0716-482/+519
|
* gh-103186: Suppress RuntimeWarning about unclosed async iterator in ↵Serhiy Storchaka2023-09-071-4/+28
| | | | test_sys_settrace (GH-109075)