From 1a6844ae32781f2117d46363ece697d509f6935d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 31 Oct 2021 08:37:15 -0400 Subject: fix: don't warn about already imported files for namespace packages #888 Ignore namespace packages in the already-imported check. #888 --- coverage/inorout.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'coverage') diff --git a/coverage/inorout.py b/coverage/inorout.py index 3bc7e54e..8badf4f7 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -479,6 +479,10 @@ class InOrOut: 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.has_dynamic_filename: # A plugin with dynamic filenames: the Python file -- cgit v1.2.1