Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Move all stdlib tests in the test package #93839

Copy link
Copy link
Closed
@vstinner

Description

@vstinner
Issue body actions

Currently, Python tests are scattered in multiple directories:

  • Lib/test/ (main one)
  • Lib/ctypes/test/
  • Lib/distutils/tests/
  • Lib/idlelib/idle_test/
  • Lib/lib2to3/tests/
  • Lib/tkinter/test/
  • Lib/unittest/test/

idlelib, ctypes, lib2to3, tkinter, unittest and distutils have their tests under their own packages. It causes multiple issues:

  • As a maintainer of Python, I have to look into these directories manually when refactoring "Python tests" (I cannot just look into Lib/test/).
  • Linux distributions have to manually put these directories into a separated packages if they want to make the main "python" package smaller, to put python tests into a separated package.
  • Makefile is more complicated since tests are installed separately, and so these directories should be listed explicitly in the TESTSUBDIRS variable.
  • Tools/scripts/generate_stdlib_module_names.py excludes manually these modules, since sys.stdlib_module_names excludes test modules.

I propose to move ctypes, idlelib, tkinter and unittest tests under Lib/test/.

For distutils and lib2to3, maybe we can just leave them where they are, since both modules are deprecated. distutils should be removed in Python 3.12. lib2to3 is scheduled for removal in Python 3.13.

Do you think that it's worth it to move these directories?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.