From 27d8255458cc28dcf1b6358a5a735d1653cba35e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 30 Apr 2021 19:43:50 -0400 Subject: fix: don't warn that dynamic plugins already imported their source files. #1150 --- tests/plugin2.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/plugin2.py') diff --git a/tests/plugin2.py b/tests/plugin2.py index c334628a..60d16206 100644 --- a/tests/plugin2.py +++ b/tests/plugin2.py @@ -7,6 +7,14 @@ import os.path import coverage +try: + import third.render # pylint: disable=unused-import +except ImportError: + # This plugin is used in a few tests. One of them has the third.render + # module, but most don't. We need to import it but not use it, so just + # try importing it and it's OK if the module doesn't exist. + pass + class Plugin(coverage.CoveragePlugin): """A file tracer plugin for testing.""" -- cgit v1.2.1