This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients berker.peksag, brett.cannon, chris.jerdonek, ezio.melotti, ncoghlan
Date 2012-11-09.12:38:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352464716.7.0.96388257934.issue16163@psf.upfronthosting.co.za>
In-reply-to
Content
OK, I thought that iter_importers was at least being tested indirectly by the tests for walk_packages:
http://hg.python.org/cpython/file/default/Lib/test/test_runpy.py#l417

However, it turns out that iter_modules() only calls iter_importers() if you don't supply an explicit path, and walk_packages() always passes an explicit path down.

I suggest looking at the walk_packages test for ideas on devising a better functional test for iter_importers. Testing iter_modules directly would be good, too.

(Note: There's a series of patches from Chris to move the walk_packages test to where it belongs in test_pkgutil, but they won't be applied until after the final 3.2 maintenance release has happened. Moving the test requires some fairly significant rearranging of the test suite to get the required helper functions out of test_runpy and into a shared, discoverable, location)
History
Date User Action Args
2012-11-09 12:38:36ncoghlansetrecipients: + ncoghlan, brett.cannon, ezio.melotti, chris.jerdonek, berker.peksag
2012-11-09 12:38:36ncoghlansetmessageid: <1352464716.7.0.96388257934.issue16163@psf.upfronthosting.co.za>
2012-11-09 12:38:36ncoghlanlinkissue16163 messages
2012-11-09 12:38:36ncoghlancreate