mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Remove unnecessary test imports (#5978)
Remove unnecessary test imports.
This commit is contained in:
parent
2b8ac3c629
commit
9f87989e7f
71 changed files with 70 additions and 121 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue