Uh oh!
There was an error while loading. Please reload this page.
gh-120417: Add #noqa: F401 to tests - #120627
Conversation
Uh oh!
There was an error while loading. Please reload this page.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
import_module() can be used if ImportError is converted to SkipTest.
I have some questions about global imports of names which are seem not used in the module.
| # In case _socket fails to build, make this test fail more gracefully | ||
| # than an AttributeError somewhere deep in concurrent.futures, email | ||
| # or unittest. | ||
| import _socket | ||
| import _socket # noqa: F401 |
There was a problem hiding this comment.
Would not using import_module() be better?
There was a problem hiding this comment.
The intent is to get an error if the module is missing, not to skip the test.
| # and it can function. | ||
| from multiprocessing.util import _cleanup_tests as multiprocessing_cleanup_tests | ||
| from concurrent.futures import ProcessPoolExecutor | ||
| from concurrent.futures import ProcessPoolExecutor # noqa: F401 |
There was a problem hiding this comment.
Why ProcessPoolExecutor is needed?
There was a problem hiding this comment.
It's explained in the comment, 2 lines above. It's a check to define _have_multiprocessing.
| # deterministic. | ||
| from test.support import sortdict | ||
| from test.support import sortdict # noqa: F401 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand why the import is important.
vstinner
commented
Jun 18, 2024
PR rebased to squash changes and fix merge conflicts. |
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
Ignore linter "imported but unused" warnings in tests when the linter doesn't understand why the import is important.