classification
Title: Test pkgutil.walk_packages in test_pkgutil instead of test_runpy
Type: enhancement Stage: needs patch
Components: Tests Versions: Python 3.3
process
Status: open Resolution:
Dependencies: 15343 15376 Superseder:
Assigned To: ncoghlan Nosy List: chris.jerdonek, eric.snow, ncoghlan
Priority: normal Keywords:

Created on 2012-07-15 09:54 by ncoghlan, last changed 2012-11-13 05:02 by eric.snow.

Messages (7)
msg165516 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-07-15 09:54
Created to record the egregious hack of relying on the test_runpy infrastructure in order to test pkgutil.walk_packages.

It gets the job done, but is a really messy way of going about it. Worth cleaning up by factoring the support code out to a helper module when there isn't a release deadline looming.
msg165519 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-07-15 11:25
Also, a second test case should be added to cover the zipimporter.zipimporter component.
msg165540 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-15 17:33
Such helper functionality could also be used in the tests of unittest.TestLoader.loadTestsFromName().  See, for example, the tests proposed for issue 7559.
msg165616 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-07-16 14:31
The walk_packages tests should also be enhanced to ensure correctly handling of namespace packages
msg165617 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-07-16 14:33
Note that the problem described in #14787 will limit the scope of what can be tested.
msg165682 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-17 07:05
I'd like to work on this if that's okay.  I've already written test cases for issue 7559 and issue 15299 that required creating temporary packages, so I understand the need.  And I'd also like to create test cases for issue 14787, which should really be done after this.

I think this should be split into two parts though: (1) refactor the create-package code in test_runpy into a separate helper module, and (2) move the refactored walk_package tests from test_runpy into test_pkgutil (so it's easier to see what has changed).

I can create a new issue for (1).
msg165686 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-07-17 08:11
That sounds good, and thanks for working on this - if we can get the tests cleaned up for the 3.3 release, that will make ongoing maintenance a lot easier.
History
Date User Action Args
2012-11-13 05:02:39eric.snowsetnosy: + eric.snow
2012-07-30 10:28:14ncoghlansetassignee: ncoghlan
2012-07-17 08:11:57ncoghlansetmessages: + msg165686
2012-07-17 07:11:43chris.jerdoneksetdependencies: + Refactor the test_runpy walk_package support code into a common location
2012-07-17 07:05:41chris.jerdoneksetmessages: + msg165682
2012-07-16 14:33:48ncoghlansetmessages: + msg165617
2012-07-16 14:31:47ncoghlansetmessages: + msg165616
2012-07-15 17:33:59chris.jerdoneksetmessages: + msg165540
2012-07-15 17:21:10chris.jerdoneksetnosy: + chris.jerdonek
2012-07-15 11:25:50ncoghlansetpriority: low -> normal
2012-07-15 11:25:42ncoghlansetmessages: + msg165519
2012-07-15 10:12:10ncoghlansetdependencies: + "pydoc -w <package>" writes out page with empty "Package Contents" section
2012-07-15 09:54:30ncoghlancreate