Remove unnecessary test imports (#5978)

Remove unnecessary test imports.
This commit is contained in:
Felix Fontein 2023-02-12 21:05:08 +01:00 committed by GitHub
commit 9f87989e7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 70 additions and 121 deletions

View file

@ -5,8 +5,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import random
from ansible_collections.community.general.tests.unit.compat import unittest
from ansible_collections.community.general.plugins.module_utils.scaleway import SecretVariables, argon2

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

View file

@ -6,7 +6,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import textwrap
import pytest