[stalbe-5] Remove unnecessary test imports (#5980)

Remove unnecessary test imports (#5978)

Remove unnecessary test imports.

(cherry picked from commit 9f87989e7f)
This commit is contained in:
Felix Fontein 2023-02-12 21:32:49 +01:00 committed by GitHub
parent 24210b32cf
commit 66e3c19a57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 96 additions and 114 deletions

View file

@ -95,14 +95,14 @@ def test_arg_format_fail(fmt, style, stars, value, expected):
def test_dependency_ctxmgr():
ctx = DependencyCtxMgr("POTATOES", "Potatoes must be installed")
with ctx:
import potatoes_that_will_never_be_there
import potatoes_that_will_never_be_there # noqa: F401, pylint: disable=unused-import
print("POTATOES: ctx.text={0}".format(ctx.text))
assert ctx.text == "Potatoes must be installed"
assert not ctx.has_it
ctx = DependencyCtxMgr("POTATOES2")
with ctx:
import potatoes_that_will_never_be_there_again
import potatoes_that_will_never_be_there_again # noqa: F401, pylint: disable=unused-import
assert not ctx.has_it
print("POTATOES2: ctx.text={0}".format(ctx.text))
assert ctx.text.startswith("No module named")
@ -110,7 +110,7 @@ def test_dependency_ctxmgr():
ctx = DependencyCtxMgr("TYPING")
with ctx:
import sys
import sys # noqa: F401, pylint: disable=unused-import
assert ctx.has_it