Skip to content

Commit f93bf7c

Browse files
authored
Automatically install tests/requirements.yml when found (#266)
1 parent d099028 commit f93bf7c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/ansible_compat/runtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ def prepare_environment( # noqa: C901
478478
"requirements.yml",
479479
"roles/requirements.yml",
480480
"collections/requirements.yml",
481+
# These is more of less the official way to store test requirements in collections so far:
482+
"tests/requirements.yml",
481483
]:
482484
self.install_requirements(Path(req_file), retry=retry, offline=offline)
483485

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
collections:
2+
- name: ansible.posix
3+
version: ">=1.0"

test/test_runtime.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,12 @@ def test_runtime_version_in_range(
637637
@pytest.mark.parametrize(
638638
("path", "scenario", "expected_collections"),
639639
(
640-
pytest.param("test/collections/acme.goodies", "default", [], id="normal"),
640+
pytest.param(
641+
"test/collections/acme.goodies",
642+
"default",
643+
["ansible.posix"],
644+
id="normal",
645+
),
641646
pytest.param(
642647
"test/collections/acme.goodies/roles/baz",
643648
"deep_scenario",

0 commit comments

Comments
 (0)