pyutilib
pyutilib copied to clipboard
Resolve coverage issues in PyUtilib
PyUtilib has a prolific habit of running, "from pyutilib.X import *" within the module init.py. While this is "convenient" for many users, I think it needs to either be removed or severely reduced.
In particular:
- This is prevents getting accurate coverage information. Nose is missing the coverage statistics for module-level lines (like def X():). These lines are parsed when the file is initially imported and, due to the
__init__
.py imports, this occurs before Nose activates the coverage plugin -- thus the lines are all showing up as uncovered. - It makes it harder to trace program flow. Client code runs things like
from pyutilib.misc import import_file, PauseGC
but a user has no way to know from which file in pyutilib/misc/* those symbols come from (BTW, they don't come from the same file!).