diff --git a/coverage/inorout.py b/coverage/inorout.py index d5e8b2269..17e11b64a 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -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)