Commit Graph

27 Commits

Author SHA1 Message Date
Erlend E. Aasland ead9e784fb
[3.11] gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) (#115069)
(cherry picked from commit 09096a1647)
2024-02-06 11:21:00 +01:00
Miss Islington (bot) 81d0c7ca5a
[3.11] gh-106368: Add test for Argument Clinic misbehaving custom converter_init() (GH-107496) (#107500)
(cherry picked from commit 2c5d206b33)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 12:32:18 +00:00
Miss Islington (bot) 51b302e3f3
[3.11] gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364) (#107366)
gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)
(cherry picked from commit 76c26eaca4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-28 00:36:34 +00:00
Erlend E. Aasland 9edeeb2014
[3.11] gh-106368: Increase Argument Clinic CLI test coverage (#107277) (#107326)
(cherry picked from commit 579100f6d7)
2023-07-26 23:02:24 +00:00
Miss Islington (bot) cebe60bb1a
[3.11] gh-106368: Increase Argument Clinic CLI test coverage (GH-107156) (#107190)
Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837b32)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-26 22:24:09 +00:00
Łukasz Langa 06f8a43995
[3.11] gh-106368: Increase coverage for Argument Clinic output directive (GH-106979) (#107002)
(cherry picked from commit ee5c01b473)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-22 14:15:18 +02:00
Miss Islington (bot) 951b08c500
[3.11] gh-106368: Increase Argument Clinic test coverage for IndentStack (GH-106933) (#106944)
(cherry picked from commit 8d228cf66f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-21 06:31:00 +00:00
Miss Islington (bot) a7acc5cb5c
[3.11] gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (GH-106833) (#106839)
(cherry picked from commit 22379c60ab)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-17 21:22:43 +00:00
Miss Islington (bot) b132b77fb1
[3.11] gh-106368: Increase Argument Clinic BlockParser test coverage (GH-106759) (#106770)
(cherry picked from commit 2d7d1aa4bc)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-15 09:48:01 +00:00
Erlend E. Aasland d22224a401
[3.11] gh-106368: Increase Argument Clinic test coverage (#106728) (#106731)
- improve output_parameter() coverage
- improve coverage for Function.kind

(cherry picked from commit ec45c513d3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>

* Fix merge
2023-07-14 01:13:43 +02:00
Miss Islington (bot) edb29f0fbe
[3.11] gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443) (#106445)
gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443)
(cherry picked from commit a941bd6c53)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-05 09:03:25 +00:00
Miss Islington (bot) 9f8aa7a6d7
[3.11] gh-106368: Add tests for permutation helpers in Argument Clinic (GH-106407) (#106410)
Added new test class PermutationTests()
(cherry picked from commit 8f6df5e9cb)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-04 14:17:26 +02:00
Miss Islington (bot) 3cc5c4a073
[3.11] gh-106368: Increase Argument Clinic test coverage (GH-106389) (#106391)
Add:

- test_disallowed_gropuing__no_matching_bracket
- test_double_slash
(cherry picked from commit 3406f8cce5)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-04 00:22:32 +00:00
Miss Islington (bot) 76889641e6
[3.11] gh-106368: Harden Argument Clinic parser tests (GH-106384) (#106388)
(cherry picked from commit 648688c137)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-03 23:35:42 +00:00
Erlend E. Aasland 3fdda976db
[3.11] gh-106368: Clean up Argument Clinic tests (#106373) (#106381)
(cherry picked from commit 3ee8dac7a1)
2023-07-03 22:33:45 +00:00
Erlend E. Aasland 52d5049cfd
[3.11] gh-106368: Increase Argument Clinic test coverage (#106369) (#106374)
Add tests for 'self' and 'defining_class' converter requirements.
(cherry picked from commit 7f4c8121db)
2023-07-03 22:07:05 +00:00
Alex Waygood d691de1d2d
[3.11] gh-104683: `clinic.py`: Improve coverage for the `parse_converter` method (#104729) (#104730) 2023-05-21 23:48:25 +00:00
Miss Islington (bot) 3d52f7e60c
[3.11] gh-104629: Don't skip test_clinic if _testclinic is missing (GH-104630) (#104632)
gh-104629: Don't skip test_clinic if _testclinic is missing (GH-104630)

Just skip the tests that depend on the _testclinic extension module;
we can still run the Python tests.
(cherry picked from commit 86ee49f469)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-18 23:20:35 +00:00
colorfulappl a3dbd4c70e
[3.11] gh-64490: Fix bugs in argument clinic varargs processing (GH-32092) (#100368)
(cherry picked from commit 0da728387c)
2022-12-28 02:10:06 +01:00
colorfulappl ba8e30c56b
[3.11] gh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH-99241) (#100352)
(cherry picked from commit 8dbe08eb7c)

Fix double-free bug mentioned at GH-99240, by moving memory clean up out of "exit" label.
2022-12-20 15:49:53 +05:30
colorfulappl c42a4ad587
[3.11] gh-64490: Fix refcount error when arguments are packed to tuple in argument clinic (GH-99233) (#100338)
(cherry picked from commit 69f6cc77d0)
2022-12-19 15:18:49 +05:30
colorfulappl dd323afea8
[3.11] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100230)
(cherry picked from commit c450c8c9ed)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-17 12:04:54 +05:30
Victor Stinner 8fba9523cf
bpo-42398: Fix "make regen-all" race condition (GH-23362)
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.
2020-11-18 15:36:27 +01:00
Hai Shi 4660597b51
bpo-40275: Use new test.support helper submodules in tests (GH-21448) 2020-08-03 18:49:18 +02:00
Eric Snow ee536b2020
bpo-36876: Add a tool that identifies unsupported global C variables. (#15877) 2019-09-11 19:49:45 +01:00
Serhiy Storchaka 837c7dc1ed
bpo-35578: Add an example file for testing Argument Clinic converters. (GH-11306) 2018-12-25 10:17:28 +02:00
Victor Stinner 65fc98e7b1
bpo-26901: Fix the Argument Clinic test suite (GH-8879)
* 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>
2018-09-03 23:17:20 +02:00