From e9f4d80fa66e0d3331e79d539329747297e54ae5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 18 Jun 2024 17:51:47 +0200 Subject: gh-120417: Add #noqa: F401 to tests (#120627) Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used. --- Lib/test/test_pkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_pkg.py') diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py index eed0fd1c6b7..a7a1c2affbe 100644 --- a/Lib/test/test_pkg.py +++ b/Lib/test/test_pkg.py @@ -94,7 +94,7 @@ class TestPkg(unittest.TestCase): def test_1(self): hier = [("t1", None), ("t1 __init__.py", "")] self.mkhier(hier) - import t1 + import t1 # noqa: F401 def test_2(self): hier = [ @@ -124,7 +124,7 @@ class TestPkg(unittest.TestCase): from t2 import sub from t2.sub import subsub - from t2.sub.subsub import spam + from t2.sub.subsub import spam # noqa: F401 self.assertEqual(sub.__name__, "t2.sub") self.assertEqual(subsub.__name__, "t2.sub.subsub") self.assertEqual(sub.subsub.__name__, "t2.sub.subsub") -- cgit v1.2.3