Closed
Labels
Description
Functional tests for the PyEval_Run family of the C API lack tests. Discovered in the discussions of PR #116637.
-
PyRun_AnyFile(may be a macro) -
PyRun_AnyFileEx(may be a macro) -
PyRun_AnyFileExFlags -
PyRun_AnyFileFlags(may be a macro) -
PyRun_File(may be a macro) -
PyRun_FileEx(may be a macro) -
PyRun_FileFlags(may be a macro) -
PyRun_InteractiveLoop(may be a macro) -
PyRun_InteractiveLoopFlags -
PyRun_InteractiveOne(may be a macro) -
PyRun_InteractiveOneFlags -
PyRun_InteractiveOneObject -
PyRun_SimpleFile(may be a macro) -
PyRun_SimpleFileEx(may be a macro) -
PyRun_SimpleFileExFlags -
PyRun_SimpleString(may be a macro) -
PyRun_SimpleStringFlags -
PyRun_String(may be a macro)
Linked PRs
- gh-117968: Add tests for the part of the PyRun family of the C API #117982
- [3.12] gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982) #118011
- gh-117968: Make the test for closed file more safe in the C API tests #118230
- [3.12] gh-117968: Make the test for closed file more safe in the C API tests (GH-118230) #118266
Activity
erlend-aasland commentedon Apr 17, 2024
cc. @serhiy-storchaka
serhiy-storchaka commentedon Apr 17, 2024
Most of these functions (especially implemented as macros) are thin wrappers around functions with richer interface, so it is not practical to repeat all tests for all functions. We only need to add comprehensive tests for base functions, and simpler tests for derived functions.
Some functions are implemented as macros, but also as real functions. It would be nice to test both implementations (only simple tests are needed).
gh-117968: Add tests for the part of the PyRun family of the C API (G…
[3.12] pythongh-117968: Add tests for the part of the PyRun family of…
[3.12] gh-117968: Add tests for the part of the PyRun family of the C…
encukou commentedon Apr 23, 2024
The
test_run_fileexflagstest that was added in #117982 sometimes crashes on LTO+PGO buildbots, see for example:Do you want to look into this?
gh-117968: Make the test for closed file more safe in the C API tests (…
pythongh-117968: Make the test for closed file more safe in the C API…
[3.12] gh-117968: Make the test for closed file more safe in the C AP…
encukou commentedon Apr 25, 2024
I'm still seeing failures; there might be two different issues. See here
vstinner commentedon Jan 27, 2025
The 2 buildbots are now green again.
What's the status of this issue? Do you have enough tests?
vstinner commentedon Apr 23, 2025
I consider that added tests are enough, since other PyRun functions are just aliases to the 2 tested functions.