Skip to content

Commit 76e7aec

Browse files
committed
feat: parametrize existing archived entry for test_try_load_feedstock
1 parent 8780e45 commit 76e7aec

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/test_make_graph.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77

88
@pytest.mark.parametrize("container_enabled", [True, False])
9+
@pytest.mark.parametrize("existing_archived", [True, False, None])
910
@pytest.mark.parametrize("mark_not_archived", [True, False])
1011
def test_try_load_feedstock(
11-
request: pytest.FixtureRequest, mark_not_archived: bool, container_enabled: bool
12+
request: pytest.FixtureRequest,
13+
mark_not_archived: bool,
14+
existing_archived: bool | None,
15+
container_enabled: bool,
1216
):
1317
if container_enabled:
1418
request.getfixturevalue("use_containers")
@@ -18,15 +22,18 @@ def test_try_load_feedstock(
1822
fake_lazy_json = FakeLazyJson() # empty dict
1923

2024
with fake_lazy_json as loaded_lazy_json:
25+
if existing_archived is not None:
26+
loaded_lazy_json["archived"] = existing_archived
2127
# FakeLazyJson is not an instance of LazyJson
2228
# noinspection PyTypeChecker
2329
data = try_load_feedstock(feedstock, loaded_lazy_json, mark_not_archived).data # type: ignore
2430

2531
if mark_not_archived:
2632
assert data["archived"] is False
27-
else:
28-
# apparently, this is how the function behaves
33+
elif existing_archived is None:
2934
assert "archived" not in data
35+
else:
36+
assert data["archived"] is existing_archived
3037

3138
assert data["feedstock_name"] == feedstock
3239
assert data["parsing_error"] is False

0 commit comments

Comments
 (0)