Skip to content

Add tests for the PyEval_Run family of the C API #117968

Description

@erlend-aasland

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

Activity

  1. erlend-aasland commented on Apr 17, 2024

    @erlend-aasland
    ContributorAuthor
  2. serhiy-storchaka commented on Apr 17, 2024

    @serhiy-storchaka
    Member

    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).

  3. added 3 commits that reference this issue on Apr 17, 2024
  4. encukou commented on Apr 23, 2024

    @encukou
    Member

    The test_run_fileexflags test that was added in #117982 sometimes crashes on LTO+PGO buildbots, see for example:

    Do you want to look into this?

  5. added a commit that references this issue on Apr 25, 2024
  6. added a commit that references this issue on Apr 25, 2024
  7. added a commit that references this issue on Apr 25, 2024
  8. encukou commented on Apr 25, 2024

    @encukou
    Member

    I'm still seeing failures; there might be two different issues. See here

  9. vstinner commented on Jan 27, 2025

    @vstinner
    Member

    The 2 buildbots are now green again.

    What's the status of this issue? Do you have enough tests?

  10. vstinner commented on Apr 23, 2025

    @vstinner
    Member

    I consider that added tests are enough, since other PyRun functions are just aliases to the 2 tested functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions