[Python-Dev] Refactoring test.support into a subpackage

Nick Coghlan ncoghlan at gmail.com
Mon Jul 15 12:22:57 CEST 2013


At the PyCon AU sprints, some of the sprinters worked on a plan Chris
Jerdonek and I came up with months ago to convert test.support from a
module into a subpackage.

This plan arose from some nasty test suite hacks in the lead up to the
release of Python 3.3, where some of the pkgutil tests ended up in
test.test_runpy so they could use the package creation infrastructure
I have in there without needing to extract a helper module with a
release imminent.

The scope of the plan covers a few distinct steps:

1. Move Lib/test/support.py to Lib/test/support/__init__.py
(http://bugs.python.org/issue15494)
2. Add a new (documented) test.support.pkg_helper submodule with the
package creation support code (http://bugs.python.org/issue15403 and
http://bugs.python.org/issue15376)
3. Move the pkgutil tests to test.test_pkgutil where they belong
(http://bugs.python.org/issue15358)
4. Move the existing test.script_helper and test.bytecode_helper
support modules into the test.support subpackage and document them (no
issue for that as yet)

These changes would be made on both 3.3 and default, to avoid future
merge conflicts (note that Indra also posted an updated patch for one
pending test suite update to cope with the relocation:
http://bugs.python.org/issue15415)

My main motivation for doing this is to give a bit more visibility to
the helpers that already exist, as well as making them easier to find
when we want to look into the details of what a test is doing. At the
moment, they tend to get lost in the sea of actual test files in the
main test directory.

(Chris and I initially held off on this while waiting for the final
3.2 release, and then that got delayed and it wasn't until Indra,
Michael and Stephen started looking into it at the sprints that I
started paying attention again)

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list