summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_clinic.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-106368: Add test for Argument Clinic misbehaving custom ↵Miss Islington (bot)2023-07-311-0/+20
| | | | | | | converter_init() (GH-107496) (#107499) (cherry picked from commit 2c5d206b33e4cdcafaaaf1eeaa189c10de332dc5) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Argument clinic tests: improve failure message when tests ↵Miss Islington (bot)2023-07-281-1/+1
| | | | | | | | in `ClinicExternalTests` fail (GH-107364) (#107365) gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364) (cherry picked from commit 76c26eaca4147ba7e3e8d7379c5a828f0b512a46) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-106368: Increase Argument Clinic CLI test coverage (GH-107277) ↵Miss Islington (bot)2023-07-261-3/+75
| | | | | | | (#107282) (cherry picked from commit 579100f6d75a27429e7f8de74935d7bc3a3e44e6) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic CLI test coverage (GH-107156) ↵Miss Islington (bot)2023-07-241-14/+176
| | | | | | | | | | | (#107189) Instead of hacking into the Clinic class, use the Argument Clinic tool to run the ClinicExternalTest test suite. (cherry picked from commit 83a2837b328c58b243f7d97bec12c64ec66681c5) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-106368: Increase coverage for Argument Clinic output directive ↵Miss Islington (bot)2023-07-221-0/+53
| | | | | | | (GH-106979) (#106994) (cherry picked from commit ee5c01b473eeadb007b9f330db3143e34e46038b) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106970: Fix Argument Clinic 'destination <name> clear' command ↵Miss Islington (bot)2023-07-221-0/+9
| | | | | | | | | | | | | | | (GH-106972) (#106983) Add test for the 'destination <name> clear' command, and the 'destination' directive in general. Fix two bugs in 'destination <name> clear' command: 1. The text attribute of the allocator is called 'text', not '_text' 2. Return after processing the 'clear' command, instead of proceeding directly to the fail(). (cherry picked from commit 3372bcba9893030e4063a9264ec0b4d1b6166883) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic test coverage for IndentStack ↵Miss Islington (bot)2023-07-211-0/+19
| | | | | | | (GH-106933) (#106943) (cherry picked from commit 8d228cf66f316803e95685d6553084f3d60cd9c5) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic test coverage for cpp.Monitor ↵Miss Islington (bot)2023-07-171-0/+49
| | | | | | | (GH-106833) (#106838) (cherry picked from commit 22379c60ab8f8b49e75da9bd032a8722af50b409) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic BlockParser test coverage ↵Miss Islington (bot)2023-07-151-4/+96
| | | | | | | (GH-106759) (#106769) (cherry picked from commit 2d7d1aa4bcd5da0177458b22b1b856db76aa20d4) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic test coverage (GH-106728) (#106730)Miss Islington (bot)2023-07-131-0/+37
| | | | | | | - improve output_parameter() coverage - improve coverage for Function.kind (cherry picked from commit ec45c513d389510930a62631a21a1dbb3f3aabb7) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-64595: Fix regression in file write logic in Argument Clinic ↵Erlend E. Aasland2023-07-051-4/+3
| | | | | | | | | | (#106449) (#106452) Revert the two commits that introduced the regressions: - gh-104152 - gh-104507 (cherry picked from commit 9d1d4f9c73a71192b22ab52a2eb9278737f98ddb)
* [3.12] gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c ↵Miss Islington (bot)2023-07-051-2/+3
| | | | | | | | (GH-106443) (#106444) gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443) (cherry picked from commit a941bd6c53ac4646926292557a7bb2a86f8025c3) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Add tests for formatting helpers in Argument Clinic ↵Miss Islington (bot)2023-07-041-0/+164
| | | | | | | | | (GH-106415) (#106438) gh-106368: Add tests for formatting helpers in Argument Clinic (GH-106415) (cherry picked from commit 2fb9480c8313ab524d333b18e4af09f05f5b8afa) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-106368: Add tests for permutation helpers in Argument Clinic ↵Miss Islington (bot)2023-07-041-0/+106
| | | | | | | | (GH-106407) (#106409) Added new test class PermutationTests() (cherry picked from commit 8f6df5e9cbc3a1689601714192aa6ecbb23e1927) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Increase Argument Clinic test coverage (GH-106389) (#106390)Miss Islington (bot)2023-07-041-0/+24
| | | | | | | | | Add: - test_disallowed_gropuing__no_matching_bracket - test_double_slash (cherry picked from commit 3406f8cce542ea4edf4153c0fac5216df283a9b1) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Harden Argument Clinic parser tests (GH-106384) (#106387)Miss Islington (bot)2023-07-031-42/+68
| | | | | (cherry picked from commit 648688c137744a623a71dc2413d2879b80c99eae) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106368: Clean up Argument Clinic tests (#106373) (#106379)Erlend E. Aasland2023-07-031-357/+441
| | | (cherry picked from commit 3ee8dac7a1b3882aa3aac7703bdae2de7b6402ad)
* [3.12] gh-106368: Increase Argument Clinic test coverage (GH-106369) (#106370)Miss Islington (bot)2023-07-031-0/+57
| | | | | | Add tests for 'self' and 'defining_class' converter requirements. (cherry picked from commit 7f4c8121db62a9f72f00f2d9f73381e82f289581) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106359: Fix corner case bugs in Argument Clinic converter parser ↵Miss Islington (bot)2023-07-031-0/+16
| | | | | | | | | | | | (GH-106361) (#106364) gh-106359: Fix corner case bugs in Argument Clinic converter parser (GH-106361) DSLParser.parse_converter() could return unusable kwdicts in some rare cases (cherry picked from commit 0da4c883cf4185efe27b711c3e0a1e6e94397610) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: `clinic.py`: Improve coverage for the `parse_converter` method ↵Alex Waygood2023-05-211-0/+39
| | | | (#104729)
* gh-104629: Don't skip test_clinic if _testclinic is missing (#104630)Erlend E. Aasland2023-05-181-2/+5
| | | | Just skip the tests that depend on the _testclinic extension module; we can still run the Python tests.
* gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)Erlend E. Aasland2023-05-121-0/+38
| | | | | | | | | Use the unused keyword param in the converter to explicitly mark an argument as unused: /*[clinic input] SomeBaseClass.stubmethod flag: bool(unused=True) [clinic start generated code]*/
* gh-64595: Argument Clinic: Touch source file if any output file changed ↵Erlend E. Aasland2023-05-051-3/+4
| | | | (#104152)
* gh-64631: Test exception messages in cloned Argument Clinic funcs (#104167)Erlend E. Aasland2023-05-051-0/+13
|
* gh-64490: Fix bugs in argument clinic varargs processing (#32092)colorfulappl2022-11-241-0/+44
|
* gh-99240: Fix double-free bug in Argument Clinic str_converter generated ↵colorfulappl2022-11-241-0/+15
| | | | | | | | code (GH-99241) Fix double-free bug mentioned at https://github.com/python/cpython/issues/99240, by moving memory clean up out of "exit" label. Automerge-Triggered-By: GH:erlend-aasland
* gh-64490: Fix refcount error when arguments are packed to tuple in argument ↵colorfulappl2022-11-241-0/+14
| | | | clinic (#99233)
* gh-96002: Add functional test for Argument Clinic (#96178)colorfulappl2022-11-211-1/+393
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-92886: [clinic.py] raise exception on invalid input instead of assertion ↵Irit Katriel2022-10-071-1/+1
| | | | | | | (GH-98051) Tests should pass with -O (assertions off). Automerge-Triggered-By: GH:iritkatriel
* bpo-42398: Fix "make regen-all" race condition (GH-23362)Victor Stinner2020-11-181-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a race condition in "make regen-all" when make -jN option is used to run jobs in parallel. The clinic.py script now only use atomic write to write files. Moveover, generated files are now left unchanged if the content does not change, to not change the file modification time. The "make regen-all" command runs "make clinic" and "make regen-importlib" targets: * "make regen-importlib" builds object files (ex: Modules/_weakref.o) from source files (ex: Modules/_weakref.c) and clinic files (ex: Modules/clinic/_weakref.c.h) * "make clinic" always rewrites all clinic files (ex: Modules/clinic/_weakref.c.h) Since there is no dependency between "clinic" and "regen-importlib" Makefile targets, these two targets can be run in parallel. Moreover, half of clinic.py file writes are not atomic and so there is a race condition when "make regen-all" runs jobs in parallel using make -jN option (which can be passed in MAKEFLAGS environment variable). Fix clinic.py to make all file writes atomic: * Add write_file() function to ensure that all file writes are atomic: write into a temporary file and then use os.replace(). * Moreover, write_file() doesn't recreate or modify the file if the content does not change to avoid modifying the file modification file. * Update test_clinic to verify these assertions with a functional test. * Remove Clinic.force attribute which was no longer used, whereas Clinic.verify remains useful.
* bpo-40275: Use new test.support helper submodules in tests (GH-21448)Hai Shi2020-08-031-1/+2
|
* bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)Eric Snow2019-09-111-10/+3
|
* bpo-35578: Add an example file for testing Argument Clinic converters. ↵Serhiy Storchaka2018-12-251-1/+17
| | | | (GH-11306)
* bpo-26901: Fix the Argument Clinic test suite (GH-8879)Victor Stinner2018-09-031-0/+802
* Fix Tools/clinic/clinic_test.py: add missing FakeClinic.destination_buffers attribute and pass a file argument to Clinic(). * Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py: add temporary Tools/clinic/ to sys.path to import the clinic module. Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>