Skip to content

Move Buffered tests from test_io to test_bufio #138013

Closed

Description

@cmaloney

Feature or enhancement

Proposal:

test_io is currently over 5000 lines long and tests a range of behaviors of lots of distinct io components. Some work to make it more modular has happened over time and there are a number of tests for specific subsets of io behavior (see: https://github.com/python/cpython/blob/main/Lib/test/test_io.py#L3-L13), including one for Buffered I/O (test_bufio.py, 74 lines currently)

About 1200 lines of test_io are Buffered I/O specific tests which are well isolated / can be moved relatively easily (BufferedReaderTest, BufferedWriterTest, BufferedRWPairTest, and BufferedRandomTest as well as their Py*/C* variants). I'd like to move them from test_io to test_bufio to make it simpler/faster to iterate / test / validate Buffered I/O behavior.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    testsTests in the Lib/test dir
    type-refactorCode refactoring (with no changes in behavior)
    and removed
    type-featureA feature request or enhancement
    on Aug 21, 2025
  2. Aniketsy commented on Aug 24, 2025

    @Aniketsy
    Contributor

    Hi @cmaloney
    Before I start working on moving the Buffered I/O-specific tests from test_io.py to test_bufio.py, I just wanted to check in and confirm if it’s okay to proceed. I’d also appreciate any guidance or considerations you’d like me to keep in mind while making this change.

    Thank you!

  3. cmaloney commented on Aug 24, 2025

    @cmaloney
    ContributorAuthor

    @Aniketsy planning to work on this myself, are some special pieces in load_tests which need to be refactored as part of this.

  4. Aniketsy commented on Aug 24, 2025

    @Aniketsy
    Contributor

    @cmaloney Thank you for clarifying, I appreciate it!

  5. added 3 commits that reference this issue on Aug 26, 2025
  6. added a commit that references this issue on Aug 31, 2025
  7. added 2 commits that reference this issue on Sep 1, 2025
  8. 14 remaining items

  9. added 3 commits that reference this issue on Sep 17, 2025
  10. added a commit that references this issue on Sep 19, 2025
  11. added a commit that references this issue on Sep 19, 2025
  12. added a commit that references this issue on Sep 30, 2025
  13. vstinner commented on Sep 30, 2025

    @vstinner
    Member

    Can we close this issue? Or do you plan to split more tests?

  14. added 3 commits that reference this issue on Sep 30, 2025
  15. cmaloney commented on Sep 30, 2025

    @cmaloney
    ContributorAuthor

    One final split then done GH-139454

  16. added a commit that references this issue on Oct 1, 2025
  17. vstinner commented on Oct 1, 2025

    @vstinner
    Member

    Nice work, thanks @cmaloney!

  18. cmaloney commented on Oct 1, 2025

    @cmaloney
    ContributorAuthor

    Thanks for reviewing!

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

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtopic-IOtype-refactorCode refactoring (with no changes in behavior)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions