summaryrefslogtreecommitdiffstats
path: root/test/test_runtime.py
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/test_runtime.py
parentAdding upstream version 4.1.11. (diff)
downloadpython-ansible-compat-upstream/4.1.12.tar.xz
python-ansible-compat-upstream/4.1.12.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/test_runtime.py')
-rw-r--r--test/test_runtime.py10
1 files changed, 6 insertions, 4 deletions
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,