summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 00:31:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 00:31:27 +0000
commit46c2b31dd58ce55ec100460ede4178adbbb34bcb (patch)
treef64045974c072e0f0563fbea384a325a6ef12d9e /test
parentAdding upstream version 4.1.11. (diff)
downloadpython-ansible-compat-46c2b31dd58ce55ec100460ede4178adbbb34bcb.tar.xz
python-ansible-compat-46c2b31dd58ce55ec100460ede4178adbbb34bcb.zip
Adding upstream version 4.1.12.upstream/4.1.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test')
-rw-r--r--test/conftest.py1
-rw-r--r--test/test_config.py1
-rw-r--r--test/test_configuration_example.py1
-rw-r--r--test/test_loaders.py1
-rw-r--r--test/test_prerun.py1
-rw-r--r--test/test_runtime.py10
-rw-r--r--test/test_runtime_example.py1
-rw-r--r--test/test_schema.py1
8 files changed, 13 insertions, 4 deletions
diff --git a/test/conftest.py b/test/conftest.py
index a1e4893..59ea315 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -1,4 +1,5 @@
"""Pytest fixtures."""
+
import importlib.metadata
import json
import pathlib
diff --git a/test/test_config.py b/test/test_config.py
index 4f854ae..ebdde00 100644
--- a/test/test_config.py
+++ b/test/test_config.py
@@ -1,4 +1,5 @@
"""Tests for ansible_compat.config submodule."""
+
import copy
import subprocess
diff --git a/test/test_configuration_example.py b/test/test_configuration_example.py
index 3a2c9b7..c7ed310 100644
--- a/test/test_configuration_example.py
+++ b/test/test_configuration_example.py
@@ -1,4 +1,5 @@
"""Sample usage of AnsibleConfig."""
+
from ansible_compat.config import AnsibleConfig
diff --git a/test/test_loaders.py b/test/test_loaders.py
index 7a91a4c..01cc892 100644
--- a/test/test_loaders.py
+++ b/test/test_loaders.py
@@ -1,4 +1,5 @@
"""Test for ansible_compat.loaders module."""
+
from pathlib import Path
from ansible_compat.loaders import colpath_from_path
diff --git a/test/test_prerun.py b/test/test_prerun.py
index 1549756..d832088 100644
--- a/test/test_prerun.py
+++ b/test/test_prerun.py
@@ -1,4 +1,5 @@
"""Tests for ansible_compat.prerun module."""
+
from pathlib import Path
from ansible_compat.prerun import get_cache_dir
diff --git a/test/test_runtime.py b/test/test_runtime.py
index 2af343d..6a110d4 100644
--- a/test/test_runtime.py
+++ b/test/test_runtime.py
@@ -1,4 +1,5 @@
"""Tests for Runtime class."""
+
# pylint: disable=protected-access
from __future__ import annotations
@@ -242,8 +243,8 @@ def cwd(path: Path) -> Iterator[None]:
def test_prerun_reqs_v1(caplog: pytest.LogCaptureFixture) -> None:
"""Checks that the linter can auto-install requirements v1 when found."""
- runtime = Runtime(verbosity=1)
path = Path(__file__).parent.parent / "examples" / "reqs_v1"
+ runtime = Runtime(project_dir=path, verbosity=1)
with cwd(path):
runtime.prepare_environment()
assert any(
@@ -257,8 +258,8 @@ def test_prerun_reqs_v1(caplog: pytest.LogCaptureFixture) -> None:
def test_prerun_reqs_v2(caplog: pytest.LogCaptureFixture) -> None:
"""Checks that the linter can auto-install requirements v2 when found."""
- runtime = Runtime(verbosity=1)
path = (Path(__file__).parent.parent / "examples" / "reqs_v2").resolve()
+ runtime = Runtime(project_dir=path, verbosity=1)
with cwd(path):
runtime.prepare_environment()
assert any(
@@ -271,9 +272,10 @@ def test_prerun_reqs_v2(caplog: pytest.LogCaptureFixture) -> None:
)
-def test_prerun_reqs_broken(runtime: Runtime) -> None:
+def test_prerun_reqs_broken() -> None:
"""Checks that the we report invalid requirements.yml file."""
path = (Path(__file__).parent.parent / "examples" / "reqs_broken").resolve()
+ runtime = Runtime(project_dir=path, verbosity=1)
with cwd(path), pytest.raises(InvalidPrerequisiteError):
runtime.prepare_environment()
@@ -580,7 +582,7 @@ def test_install_galaxy_role_name_role_name_check_equals_to_1(
caplog: pytest.LogCaptureFixture,
) -> None:
"""Check install role with bad role name in galaxy info."""
- caplog.set_level(logging.WARN)
+ caplog.set_level(logging.WARNING)
pathlib.Path(f"{runtime_tmp.project_dir}/meta").mkdir()
pathlib.Path(f"{runtime_tmp.project_dir}/meta/main.yml").write_text(
galaxy_info,
diff --git a/test/test_runtime_example.py b/test/test_runtime_example.py
index e500e59..17be483 100644
--- a/test/test_runtime_example.py
+++ b/test/test_runtime_example.py
@@ -1,4 +1,5 @@
"""Sample use of Runtime class."""
+
from ansible_compat.runtime import Runtime
diff --git a/test/test_schema.py b/test/test_schema.py
index b253cb5..10c1a9a 100644
--- a/test/test_schema.py
+++ b/test/test_schema.py
@@ -1,4 +1,5 @@
"""Tests for schema utilities."""
+
from __future__ import annotations
import json