pyutilib icon indicating copy to clipboard operation
pyutilib copied to clipboard

Resolve coverage issues in PyUtilib

Open whart222 opened this issue 8 years ago • 0 comments

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:

  1. 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.
  2. 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!).

whart222 avatar Nov 15 '15 02:11 whart222