mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
7e189aed64
commit
e9f4d80fa6
24 changed files with 43 additions and 41 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue