Skip to content

Commit

Permalink
Ignore namespace packages in the already-imported check. #888
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 4, 2020
1 parent acf063c commit d90c675
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions coverage/inorout.py
Expand Up @@ -359,6 +359,10 @@ def warn_already_imported_files(self):
if filename in warned:
continue

if len(getattr(mod, "__path__", ())) > 1:
# A namespace package, which confuses this code, so ignore it.
continue

disp = self.should_trace(filename)
if disp.trace:
msg = "Already imported a file that will be measured: {}".format(filename)
Expand Down

0 comments on commit d90c675

Please sign in to comment.