Nick Coghlan added the comment:

OK, I thought that iter_importers was at least being tested indirectly by the 
tests for walk_packages:

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)


Python tracker <>
Python-bugs-list mailing list

Reply via email to